This server has critical definition quality gaps across most tools. Only 2 of 5 tools have descriptions above 20 characters. Parameters lack type constraints (no enums for trading symbols, no ranges for quantities). Output schemas are completely undocumented, tools return JSON.stringify() with no indication of field structure. The 'add' tool is vestigial and clutters the interface. Error handling is absent, all try-catch blocks log to console but return nothing on failure, leaving LLMs without recovery guidance. No tool has documented output structure. Security is compromised: access tokens are hardcoded in index.ts and the trading symbol parameter accepts any string without validation.
Tools (5)
addread onlysource verified62/100
Addition tool for adding two numbers
buyStockwriteauthsource verified43/100
Buy stock with specified trading symbol and quantity
getHoldingsread onlyauthsource verified35/100
Get current stock holdings
getPositionsread onlyauthsource verified35/100
Get current open positions
sellStockwriteauthsource verified43/100
Sell stock with specified trading symbol and quantity
No output schemas documented. Tools return JSON.stringify() with no indication of response structure, field types, or required fields. LLMs cannot plan downstream tool calls or extract specific data.
Parameters accept free-form strings with no validation. 'tradingsymbol' has no enum, regex pattern, or format constraint. This invites LLMs to hallucinate invalid stock symbols and cause failed orders.
Hardcoded secrets in source code. apiKey and access_token are visible in index.ts. If this repo is public, credentials are compromised. Secrets must never appear as tool parameters or in source files.
No error recovery guidance. All try-catch blocks console.error() and return undefined. LLMs receive no indication of what went wrong (authentication failed? network error? invalid symbol?) or what to do next.
Recommendations
Add explicit output schemas to every tool. For sellStock/buyStock, document: { order_id: string, status: 'placed'|'rejected', symbol: string, quantity: number, transaction_id?: string, error?: string }. For getPositions/getHoldings, document the field structure returned by Zerodha API.
Add enum constraints and ranges to parameters. Replace z.string() with z.enum(['NSE_SYMBOL', 'BSE_SYMBOL', ...]) for tradingsymbol, or document the valid formats. Replace z.number() with z.number().int().min(1).max(10000) for quantity.
Move hardcoded credentials to environment variables. Read apiKey and access_token from process.env.ZERODHA_API_KEY and process.env.ZERODHA_ACCESS_TOKEN. Document the required env vars in README.
Expand tool descriptions to 50-200 characters with context. Example: 'Place a market order to sell stock. Returns order_id and confirmation status. Note: This executes immediately, no cancellation available for market orders.' This signals irreversibility.
Add error recovery guidance. When Zerodha API returns an error, catch it specifically and return: { type: 'error', code: 'INVALID_SYMBOL', message: 'Symbol INVALID_NSE not found on NSE. Try searching with a partial name first.', recoveryHint: 'Use search_symbols() to find valid trading symbols.' }
Implement a dry-run or confirmation pattern for trading tools. Add an optional 'confirm' parameter (default false). If false, return a preview of the trade (symbol, qty, estimated cost). If true, execute. This prevents accidental trades.
Tool descriptions are too short (<20 chars) for effective LLM selection. 'Get current open positions' and 'Get current stock holdings' lack context on when to use each, what data structure they return, or prerequisites.
Destructive operations (sellStock, buyStock) have no confirmation step or dry-run capability. Agents can accidentally execute real trades. No audit trail or recovery mechanism.
The 'add' tool is unrelated to trading functionality and pollutes the tool namespace. It appears to be a leftover test tool. Remove it or move to a separate testing server.
No permission gating. Any agent with access to this server can execute trades. There is no validation of agent identity, user authorization, or least-privilege scoping.
Quantity parameter accepts any number (z.number()) with no minimum or maximum. LLMs could pass negative quantities, zero, or absurdly large orders causing API errors or financial loss.
Return values do not include chaining IDs. After buyStock succeeds, the agent receives only 'Stock bought successfully' (text string). No order_id, transaction_id, or reference to track the trade.
sellStockbuyStock
Add parameter descriptions for all inputs. For tradingsymbol: 'NSE or BSE trading symbol (e.g., RELIANCE, TCS). Must be a valid listed company symbol.' For quantity: 'Number of shares to buy/sell (1 - 10000, must be in tradeable lots).'
Remove the 'add' tool or move it to a separate test server. It has no relationship to trading and adds noise to tool discovery.
Implement permission checking. Before executing trades, log the agent's identity and require explicit authorization. At minimum, warn when an agent attempts a write operation.
Document all parameters with type and valid ranges. Add JSDoc comments to each tool function or Zod refinements to validate inputs before calling Zerodha API.
Return structured trade confirmations. Include order_id, symbol, quantity, status, and a timestamp. This enables the agent to track trades and cancel if needed.
Add rate limiting and daily trade limits to prevent runaway agents from placing thousands of orders.
Create a separate 'cancel_order' tool to allow agents to undo mistaken trades within the cancellation window.