An MCP server for executing trading operations on Zerodha (Indian stock exchange broker) including placing buy/sell orders, retrieving holdings, managing orders, and fetching order history
This server exhibits pervasive definition quality issues across all dimensions. Tool descriptions are present but minimal (average 8-12 words, well below the 194-char baseline). Parameters lack actionable details, 'quantity' and 'symbol' have trivial descriptions that do not explain format constraints, valid ranges, or dependencies. The server mixes trivial utility functions (add two numbers) with high-stakes financial operations (place buy/sell orders, cancel orders), yet applies identical shallow documentation to both. No output schemas are documented. Error handling is generic catch-all patterns that return string responses ('failed to fetch orders error:{e}') rather than structured errors with recovery guidance. Critical financial tools like placeBuyStockOrder and sellStocks expose live market risk without safeguards: no confirmation step, no dry-run capability, no validation of quantity bounds, no idempotency guarantees. The add() tool is mathematically trivial and should not exist in a trading server. Tool names are adequate (verb_noun structure) but composition is poor.
Add two numbers
Cancel all the order with the specified order id
this is to fetch all the holdings for the user in zerodha
Get all the orders from zerodha
Place a order on zerodha of the defined quantity for the symbol
Sell the stock on zerodha
Trivial tool in trading domain: 'add' tool (add two numbers) has no business purpose in a stock trading server. This dilutes the agent's tool selection and wastes cognitive overhead. Remove it entirely.
Destructive financial operations lack confirmation or dry-run. placeBuyStockOrder and sellStocks place real orders without a confirmation_required pattern or dry-run step. Agents can accidentally execute large trades.
Parameter descriptions are trivial and lack actionable constraints. 'symbol' parameter: no format specified (e.g., NSE ticker format, uppercase requirement). 'quantity' parameter: no range bounds (min 1 share, max position limit?). These omissions force LLMs to guess valid values.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 8 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 33 | - | v1 |
No output schemas documented. Tools return unstructured strings ('Orders fetched successfully {data}', 'order buy placed successfullt {data}') instead of structured JSON with typed fields. Agents cannot parse results reliably or extract IDs for chaining.
Generic error handling with no recovery guidance. All tools catch exceptions and return 'failed to {action} error:{e}' strings. No categorization of retryable vs. fatal errors. No actionable next steps for the agent (e.g., 'Invalid symbol. Call list_available_symbols() first.')
Tool descriptions are under 20 characters on average. 'Get all the orders from zerodha' (37 chars) is minimal; 'Sell the stock on zerodha' (25 chars) lacks context on when to use it vs. placeBuyStockOrder. Descriptions do not explain prerequisites, expected success behavior, or side effects.
No input validation or range checking in tool logic. quantity parameter accepts any int; no minimum (1 share minimum?), no maximum (position limit?), no check for negative numbers. LLMs could accidentally request -100 shares.
No idempotency guarantees on reversible operations. cancelOrder accepts an order_id but does not document whether re-canceling the same order is safe. If an agent retries a cancel due to timeout, it could fail with 'order not found' on the second attempt.
Credential management visible in code: ACCESS_TOKEN, API_KEY, API_SECRET loaded from .env in trade.py. While using environment variables is better than hard-coding, there is no validation that these are injected securely at runtime. If this server is compromised, Zerodha credentials are exposed.
No permission gates or audit trails. Any caller can invoke placeBuyStockOrder or sellStocks. No verification of user authority, no logging of who called what tool with which parameters, no compliance trace for regulatory oversight.