Skip to main content
Glama

Build: buy an index

build_buy_index
Read-only

Buy an index with USDC alone: one transaction buys every basket token on KyberSwap and mints the shares, reverting below the quoted minimum. Unspent USDC is refunded.

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": {
      "wallet": "<wallet>",
      "index": "<index>",
      "usdcAmount": "<usdcAmount>"
    },
    "name": "build_buy_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
indexYesthe index's token address
walletYesthe agent's wallet address — the one that will sign and send the calls
usdcAmountYesUSDC to spend at most, as a decimal string, e.g. "25" or "0.5"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

The description adds real behavior beyond the annotations: atomicity (one transaction), the routing venue (KyberSwap), slippage protection ('reverting below the quoted minimum'), and refund of unspent USDC. However, it never resolves whether the tool itself executes the swap or only constructs the calls — the schema hints at construction ('will sign and send the calls'), and the annotations declare readOnlyHint=true, so the wording 'one transaction buys every basket token' leaves an important ambiguity. It also doesn't say where the quoted minimum comes from or whether the caller can influence it.

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?

Two dense sentences, front-loaded with the intent followed by the execution characteristics. Every clause carries information — venue, atomicity, slippage behavior, refund — with no filler or redundancy.

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

Completeness3/5

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

For a three-parameter, no-output-schema tool, the description covers the spend semantics and the failure mode well. It is still thin on what the call actually produces (calldata vs. an executed transaction) and on preconditions like token approval, which matter for an agent deciding whether it can call this now.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning: 'Unspent USDC is refunded' clarifies that usdcAmount is a hard ceiling rather than an exact spend, and 'reverting below the quoted minimum' explains the failure condition tied to the index being purchased. No help is given on the address formats, but the schema already covers those.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Buy an index') and scopes it precisely ('with USDC alone'), which separates it from a sell or a multi-asset/create variant. It goes further to explain the mechanism — one transaction purchases every basket token on KyberSwap and mints shares — so an agent knows exactly what operation this represents.

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?

Usage is only implied: an agent can infer 'call this when you want exposure to an index paying with USDC.' There is no explicit when-not guidance, no mention of prerequisites such as USDC balance/approval, and no reference to a quote or index-registration step that must precede the buy.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources