getAllCompanies
Retrieve all companies from the Mews MCP server, with optional filters for company IDs, names, creation or update date range, and pagination settings.
Instructions
Returns all companies, optionally filtered by criteria
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| CompanyIds | No | Filter by specific company IDs | |
| CreatedUtc | No | Date range filter for company creation | |
| Limitation | No | Pagination settings | |
| Names | No | Filter by company names | |
| UpdatedUtc | No | Date range filter for company updates |
Implementation Reference
- The execute function that handles the tool logic: parses args, calls mewsRequest to '/api/connector/v1/companies/getAll', and returns JSON result.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const inputArgs = args as Record<string, unknown>; const requestData = { Limitation: { Count: 100 }, ...inputArgs }; const result = await mewsRequest(config, '/api/connector/v1/companies/getAll', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema defining optional filters (CompanyIds, Names, date ranges) and pagination (Limitation).inputSchema: { type: 'object', properties: { CompanyIds: { type: 'array', items: { type: 'string' }, description: 'Filter by specific company IDs', maxItems: 1000 }, Names: { type: 'array', items: { type: 'string' }, description: 'Filter by company names', maxItems: 1000 }, CreatedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of creation date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of creation date range (ISO 8601)' } }, description: 'Date range filter for company creation' }, UpdatedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of update date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of update date range (ISO 8601)' } }, description: 'Date range filter for company updates' }, Limitation: { type: 'object', properties: { Count: { type: 'number', description: 'Maximum number of companies to return' }, Cursor: { type: 'string', description: 'Pagination cursor for next page' } }, description: 'Pagination settings' } }, additionalProperties: false },
- src/tools/index.ts:100-100 (registration)The tool is registered by inclusion in the exported allTools array.getAllCompaniesTool,
- src/tools/index.ts:15-15 (registration)Import of the getAllCompaniesTool for registration in index.ts.import { getAllCompaniesTool } from './companies/getAllCompanies.js';