Skip to main content
Glama

ingest_trades

Validate and store trades from a broker or exchange statement, replacing prior uploads for the same source and returning accepted or rejected with per-trade errors.

Instructions

Validate and store trades from one broker or exchange statement.

source names the statement, e.g. "zerodha" or "groww". Re-submitting the same source replaces its earlier upload. Returns status "accepted" when there are no errors, otherwise "rejected" and nothing is stored. Each error has the trade index and a message, so fix the mapping and resubmit. Warnings do not block.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "assessment_year": "<assessment_year>",
      "source": "<source>",
      "trades": "<trades>"
    },
    "name": "ingest_trades"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYes
tradesYes
assessment_yearYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely does: it discloses idempotent replace-by-source semantics, the all-or-nothing validation gate ('rejected' stores nothing), error granularity (trade index + message), and that warnings are non-blocking. It omits anything about permissions, size limits, or what the accepted response contains beyond status.

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?

Three tight paragraphs, front-loaded with the core action, then the identity rule, then the outcome/error contract. No sentence is redundant.

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

Completeness4/5

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

For a 3-parameter ingestion tool with a rich nested schema and no output schema, it covers the critical behaviors (replacement, rejection semantics, error shape). The remaining gap is guidance on the assessment_year parameter and required trade fields, which the agent must derive from the schema alone.

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 0%, so the description must compensate. It gives useful examples for `source` ('zerodha', 'groww'), but says nothing about `trades` contents or the `assessment_year` value, leaving the agent to infer the structure from the bare titles and enums in NormalizedTrade.

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?

States a specific verb pair (validate and store) and resource (trades from one broker or exchange statement), which separates it from the document-ingestion siblings (ingest_ais, ingest_26as, ingest_form16). It does not explicitly name those siblings, but the resource distinction is unambiguous.

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

Usage Guidelines3/5

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

Implied usage is clear (feed it a parsed broker statement), and it gives an important operational rule: re-submitting the same source replaces the earlier upload. However, it never says when to prefer this over the other ingest_* tools, nor what prerequisites or input format mapping is expected.

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