MCP Gateway - translate MCP tool-callings to HTTP requests
The MCP Gateway server exposes a single dynamically-loaded tool 'dynamic_tools_from_config' that forwards HTTP requests or executes shell commands based on YAML configuration. The tool definition is present in server.py (lines 81-110) but has critical deficiencies: the tool name violates verb_noun naming conventions, the description is generic and non-actionable, the input schema lacks parameter type definitions and descriptions, and error handling is minimal. The tool's purpose, acting as a gateway to forward external requests, is inferred from code structure rather than explicit documentation. For users of this server, the YAML config file (not provided in source) is the actual interface; the MCP tool itself is poorly documented.
Tools are dynamically loaded from config.yaml. Each tool can forward HTTP requests or execute shell commands based on requestTemplate configuration.
Tool name violates verb_noun convention. 'dynamic_tools_from_config' is a noun phrase describing how tools are loaded, not an action verb describing what the user does when calling it. Should be named after the action (e.g., 'execute_gateway_command', 'forward_http_request', or 'invoke_external_service') to signal intent to LLMs.
Input schema has zero parameter descriptions. The schema declares properties (line 95-99) with only 'type: string' and 'description' pulled from YAML config, but no actual descriptions are visible in the server code. LLMs cannot infer parameter meaning from names alone (e.g., what does 'entity_id' mean to a downstream system?). This violates the 20-character minimum description rule.
Tool description (line 94) is 141 characters but generic and non-actionable: 'Tools are dynamically loaded from config.yaml. Each tool can forward HTTP requests or execute shell commands based on requestTemplate configuration.' This tells the LLM what the server does internally (how tools are loaded) rather than what calling the tool achieves (what action the user takes). No guidance on when to use it, what it returns, or what prerequisites exist.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 25 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 24 | - | v1 |
Input schema structure incomplete. Lines 93-100 define tool properties from config, but the schema itself has no 'required' array (commented out on line 98), no min/max constraints on string length, and no enum constraints for choice parameters. Per the rubric baseline, 100% of A+ tools document return types and input constraints; this tool has neither.
Output schema not documented. The tool returns 'list[types.TextContent | types.ImageContent | types.EmbeddedResource]' (line 108) but the LLM has no documentation of what fields or structure to expect. Per the rubric, 100% of A+ tools have documented return types; this tool has zero guidance on output format, fields, or how to extract data from the response.
Error handling lacks recovery guidance. Lines 106-107 raise generic ValueErrors ('Unknown tool', 'missing requestTemplate') with no actionable next step. Per the rubric pattern:recovery-guide, error responses must tell the LLM what to do next. Current errors give the agent nothing, no suggestions for valid tool names, no hints about config reloading, no retryable vs. fatal classification.
Command injection risk. Lines 48-64 (execute_command_tool) accept a 'command' string from config and user-provided 'arguments' dict, then render them via Jinja2 template and execute via asyncio.create_subprocess_exec. While arguments are shlex.quoted (line 57), the command itself is not validated, a malicious config entry like 'command: rm -rf /' would execute without guard. The tool description (line 94) does not warn users or the LLM about injection risks or that shell commands are potentially destructive.
No idempotency or confirmation for destructive operations. The tool can execute arbitrary shell commands via config (lines 48-64) with no dry-run option, no confirmation step, and no idempotency guarantee. Per the rubric, irreversible operations should support dry-run or confirmation. An LLM could accidentally trigger 'rm -rf' or other destructive operations with no safeguard.
Tool parameters are inferred from YAML config, not explicitly defined in the schema. Lines 86-91 loop over config['tools'] and create properties from tool['args'], but the actual parameters and their constraints are invisible to the MCP server code, they come from an external config.yaml file not provided in the source.