Skip to main content
Glama

getAllCompanies

Retrieve company data from Mews hospitality platform with optional filters by ID, name, creation date, or update date for management and analysis.

Instructions

Returns all companies, optionally filtered by criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
CompanyIdsNoFilter by specific company IDs
NamesNoFilter by company names
CreatedUtcNoDate range filter for company creation
UpdatedUtcNoDate range filter for company updates
LimitationNoPagination settings

Implementation Reference

  • The execute function implementing the core logic: parses input args, constructs request data with default limitation, calls mewsRequest to '/api/connector/v1/companies/getAll', and returns JSON stringified 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, CreatedUtc/UpdatedUtc ranges, and Limitation for pagination.
    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 },
  • Exports the complete Tool object 'getAllCompaniesTool' with name, description, inputSchema, and execute handler.
    export const getAllCompaniesTool: Tool = { name: 'getAllCompanies', description: 'Returns all companies, optionally filtered by criteria', 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 }, 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) }] }; } };
  • Includes getAllCompaniesTool in the allTools array for global tool registry.
    getAllCompaniesTool,
  • Imports the getAllCompaniesTool from './companies/getAllCompanies.js'.
    import { getAllCompaniesTool } from './companies/getAllCompanies.js';

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/code-rabi/mews-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server