Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

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';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns data (implying read-only) but doesn't mention potential side effects, rate limits, authentication requirements, or what happens with large result sets. The description lacks details on return format, error conditions, or whether this is a paginated operation (though the schema hints at pagination via 'Limitation').

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 7 words, front-loading the core purpose with zero wasted language. Every word earns its place: 'Returns' (action), 'all companies' (resource), 'optionally filtered by criteria' (capability).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'returns' means in practice (format, structure), doesn't warn about potential performance implications of 'all companies,' and provides no context about the filtering system. The schema handles parameter documentation, but behavioral and usage context is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds minimal value beyond stating 'optionally filtered by criteria,' which is already implied by the parameter existence. No additional semantic context is provided about parameter interactions or filtering logic.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Returns all companies, optionally filtered by criteria.' It specifies the verb ('returns') and resource ('companies'), and mentions filtering capability. However, it doesn't distinguish this tool from other 'getAll' siblings like 'getAllCustomers' or 'getAllReservations' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, when filtering is appropriate, or how this differs from other company-related tools like 'deleteCompanies' or 'updateCompanies' in the sibling list. The phrase 'optionally filtered' hints at usage but lacks explicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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