Static source inference · medium confidence · detected: Logging
Deprecated protocol patterns detected
Summary
The Cost Management MCP server has critical gaps in tool definition quality. While the server implements 10 READ_ONLY tools for cost management across multiple cloud providers (AWS, OpenAI, Anthropic), the actual tool schemas and descriptions are not visible in the provided source code. The server.ts file shows tool registration via `toolDefinitions` imported from './tools/registry', but the registry file and individual tool definition files (getCosts.ts, listProviders.ts, etc.) were not included in the source excerpt. This means we cannot verify: (1) whether input schemas exist and are properly typed, (2) whether tool descriptions are present and actionable, (3) whether parameters are documented.
Tool definitions not visible in source code. Files src/tools/getCosts.ts, src/tools/listProviders.ts, and others referenced but not provided. Cannot verify input schemas, parameter descriptions, or output documentation.
CRITICAL: Provide all tool definition files (src/tools/*.ts). Each must export a Tool object with name, description, inputSchema, and output schema. Example structure: export const getCostTool = { metadata: { name: 'get_costs', description: 'Retrieve aggregated costs across all enabled providers for a date range. Use this to get a high-level cost overview. Returns costs by provider and service.', inputSchema: { type: 'object', properties: { start_date: { type: 'string', format: 'date', description: 'ISO 8601 start date (inclusive), e.g., 2024-01-01' }, end_date: { type: 'string', format: 'date', description: 'ISO 8601 end date (inclusive)' }, provider: { type: 'string', enum: ['aws', 'openai', 'anthropic', 'all'], description: 'Filter by provider. Omit or set to "all" for aggregated costs.' } }, required: ['start_date', 'end_date'] } }, handler: async (args, providers) => { ... } }
ADD descriptions to every tool. Follow the pattern: [ACTION] [RESOURCE] [SCOPE]. Example: 'Retrieve total costs across all enabled providers for a specified date range. Call this first to see aggregate spend before drilling into provider-specific costs.' (80-150 chars, actionable, includes when to use).
ADD full parameter descriptions. Every parameter must explain what it controls, valid values/ranges, and format. Example for start_date: 'ISO 8601 start date (inclusive), e.g., 2024-01-01. Must be before end_date.'
ADD output schema documentation as comments or in a separate types file. Example: 'Returns { success: boolean, data: { provider: string, total_cost: number, currency: string, breakdown: { service: string, cost: number }[] }, error?: { code: string, message: string } }'.
Spec posture evidence
Inferred effective spec: <=2025-11-25.
Relies on Logging (deprecated) - log to stderr or use OpenTelemetry
No output schema documentation visible. Cannot verify that tools document return types, field names, pagination structure, or whether responses include IDs needed for tool chaining.
Error handling details not visible. The handleError() function in server.ts catches errors and returns error codes + messages, but without seeing tool implementations, cannot verify: are errors actionable? Do they guide recovery? Are they categorized as retryable vs fatal?
Tooling names 'getOpenAICostsTool', 'getAnthropicCostsTool', 'getAWSCostsTool' mix framework-specific suffixes ('Tool') with camelCase. MCP convention is snake_case names without suffixes. Should be: get_openai_costs, get_anthropic_costs, get_aws_costs (without 'Tool' suffix and in snake_case).
Potential ambiguity between 'getCostTool' (aggregate costs?) vs provider-specific tools. Without descriptions, LLM cannot distinguish when to call getCostTool vs getOpenAICostsTool vs getAWSCostsTool. All three may return similar data structures but with different scope.
DISTINGUISH provider-specific tools in their descriptions. Example: get_openai_costs: 'Retrieve costs from OpenAI API usage (models, tokens, endpoints). Use this when you need OpenAI-only data.' vs get_aws_costs: 'Retrieve AWS service costs (EC2, S3, RDS, etc.) from Cost Explorer. Use this for AWS infrastructure spend.'
ADD input validation and constraints. Use JSON Schema enums for provider names, date formats, and limit ranges. Example: { limit: { type: 'integer', minimum: 1, maximum: 100, default: 20, description: 'Max results to return (1-100, default 20)' } }
ADD pagination parameters to list tools (listProviders, getCostPeriods, getCostBreakdown). Include offset/limit and document total_count in return schema.
ADD output example in each tool's documentation (as a comment, not in description text). Example: '{ "success": true, "data": { "costs": [{ "provider": "aws", "amount": 1234.56, "currency": "USD" }] } }'
ENHANCE error messages. In tool handlers, return structured errors with actionable guidance. Example: instead of 'Provider not found', return 'Provider "gcp" not available. Enabled providers: aws, openai, anthropic. Configure GCP credentials in .env to enable.'
ADD tool composition hints. If get_costs → compare_providers → get_cost_trends is a common workflow, document it in get_costs description: 'After retrieving costs, use compare_providers to analyze efficiency across providers.'
DOCUMENT permissions/scope required by each tool (e.g., 'Requires read:cost_explorer for AWS, read:billing for OpenAI'). This enables audit trails and least-privilege agent config.