Get Companies
machship_get_companiesRetrieve all companies accessible to the authenticated user, optionally filtered by company hierarchy, to find company IDs and names for other Machship operations.
Instructions
Returns all companies accessible to the authenticated user.
Args:
atOrBelowCompanyId (number, optional): Filter to companies at or below this company in the hierarchy
response_format ('json' | 'markdown'): Output format (default: 'json')
Returns: Array of company objects, each containing: { "id": number, // Company ID — use this in other tool calls "name": string, // Display name of the company "isActive": boolean, // Whether the company is active "parentCompanyId": number | null }
Examples:
Use when: "List all companies I have access to"
Use when: "What company ID does Acme Corp have?" -> call this, then search by name
Don't use when: You need carrier/service info (use machship_get_company_carriers instead)
Error Handling:
Error 401: Check MACHSHIP_API_TOKEN is set correctly
Error 403: Token lacks permission to list companies
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | Output format: 'json' (machine-readable, default) or 'markdown' (human-readable) | json |
| atOrBelowCompanyId | No | Limit to companies at or below this company ID in the hierarchy |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| errors | No | Validation errors returned by Machship, if any | |
| object | No | Response payload from the Machship API |