Work across several entities

Guides the use of multi-entity tools with the Spendesk org-level token. Explains entity context management for multi-company groups.

CFOController๐Ÿ” Ad hocExpertRead-only

Ask it like this

Show the spend of each entity in the group.

When to use it

When your connection covers several companies and you want to compare them or move from one to another.

What it produces

Group entity list with context switching examples and multi-entity call patterns.

How it works

  1. 1Lists the companies you have access to
  2. 2Has you specify which company or companies you mean
  3. 3Queries each company separately
  4. 4Presents results side by side, without adding currencies
  5. 5Flags the companies it could not read

What protects you

  • This skill only reads: it changes nothing in Spendesk
  • It acts with your permissions and your role, never beyond
  • The assistant cannot approve or pay
โ–ธTechnical detail81/100 ยท 1 tools
Multi-entitylist_companies

# Instructions โ€” Multi-entity and token handling

## โš ๏ธ Behavior of list_companies depending on token type

| Token type | Number of entities | id | name |
|------------|-----------|-----|------|
| **org-level** | The active entities the user is a member of with a controller or account owner role (possibly a partial list) | โœ… present | โœ… present |
| **company-scoped** | 1 single entity | โœ… present | **โŒ absent** (only `id` and `appUrl` are returned) |

If `company.name=null`: don't display "null" โ€” show "current entity" or use the id instead.

## Step 1 โ€” List the available entities

Call `list_companies` (no parameters).

**With an org-level token**: returns the active entities the user is a member of with a controller or account owner role, with id + name + appUrl. The list may be partial: never present it as the group's complete entity list.
**With a company-scoped token**: returns 1 entity with id only.

Inspect the response:
- If 1 entity and `name=null` โ†’ company-scoped token โ†’ continue with this id
- If several entities with name โ†’ org-level token โ†’ select according to the need

## Step 2 โ€” Select the target entity or entities

**For a single-entity analysis**: choose the entity by name or by currency as needed.

**For a consolidated multi-entity analysis**:
- Iterate over each companyId
- Call the desired tool for each entity
- Combine the results **only after having all results** (never present partial results)

โš ๏ธ Functional currencies vary by entity โ€” **never sum across currencies**.
Use the `functionalAmount` specific to each entity and display them separately, or convert explicitly.

## Step 3 โ€” Available data (real org-level token example)

11 entities on this account, including:
```
B1stUp83     โ†’ SPENDESK (EUR)
Hx1N5m87M   โ†’ Spendesk Limited (GBP)
pD0gYhOK75T โ†’ Spendesk Inc. (USD)
RRbRgeIB7X  โ†’ Spendesk GmbH (EUR)
vvdk2xwqvktsjl โ†’ Spendesk USD Test (USD)
```

## Step 4 โ€” Consolidated multi-entity analysis (pattern)

```
For each companyId in list_companies.data:
  1. Call spendesk_analyze_spend(companyId, fromDate, toDate, groupBy)
  2. Extract summary.totalAmount (entity's functional currency)
  3. Store result + currency

Display:
  Entity A: X EUR (N payables)
  Entity B: Y GBP (N payables)
  Entity C: Z USD (N payables)
  โš ๏ธ Consolidated total in EUR = conversion needed (not provided by the MCP)
```

## Edge case: company-scoped token with a companyId already known

If the token is company-scoped, the tools accept an optional `companyId` (auto-filled).
Passing the companyId explicitly is unnecessary but harmless โ€” the token only accesses its own entity anyway.

## Example prompt

- "Show the spend for each entity in the group" โ†’ iterate over list_companies + analyze_spend
- "What's the wallet balance for all our subsidiaries?" โ†’ iterate over list_companies + get_wallet_summary
- "Compare France vs UK spend" โ†’ 2 calls to analyze_spend on B1stUp83 and Hx1N5m87M

How to install this skill

/
  1. 1
    Download the file s41-multi-entity-org-token.md using the button above.
  2. 2
    Place the file in the .claude/ directory of your project (or ~/.claude/ for a global install).
    cp s41-multi-entity-org-token.md .claude/s41-multi-entity-org-token.md
  3. 3
    Use in Claude Code โ€” the skill is automatically discovered. Describe your need in natural language and Claude will apply the skill instructions.
๐Ÿ’ก Make sure the Spendesk MCP is configured in your .claude/settings.json with the tools list_companies.

Similar skills

โ˜… Top
95/100ยท๐Ÿ” Ad hocยทExpert

Audit what the MCP covers

Probes all available MCP tools, re-evaluates coverage of 50 persona use cases, detects new fields or tools, and regenerates the gap analysis report.

CFOControllerAP Manager
90/100ยท๐Ÿ“… WeeklyยทBeginner

Card requests via get_requests

Explains how to use get_requests for card requests and why expense reimbursements don't appear there. Avoids a frequent source of confusion between two distinct workflows.

ControllerFinance Analyst
90/100ยท๐Ÿ” Ad hocยทIntermediate

Active vs archived cost centers

Distinguishes active cost centers from archived ones with correct use of get_cost_centers. Avoids the counter-intuitive isArchived vs isActive naming convention pitfall.

ControllerFinance Analyst

Interested in AI Agent services or Custom Integrations?