Skip to main content
Glama

Prepare: buy a stock

buy_stock
Read-onlyIdempotent

Unsigned transactions for a plain spot buy: the wallet's USDG buys a stock token on Uniswap, through the stock's own pools (the ones Borro's short desk trades on), and the token arrives in the wallet. No loan, no leverage, no Borro contract; supply lends it afterwards if it should earn lending fees. Exact in: all the USDG is spent and at least the quote less slip_bps arrives, or nothing is spent. Borro's fee, the same as the site's Buy tab takes, comes out of the USDG inside the swap (fee_usdg and fee_bps in the quote). Exact approvals first when they are missing: USDG to Permit2 (Uniswap's approval contract), then Permit2's allowance for Uniswap's Universal Router, which lapses after 30 minutes. Priced now; simulated from the wallet in order.

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>",
      "symbol": "<symbol>",
      "usdg": "<usdg>"
    },
    "name": "buy_stock"
  }
}

Input Schema

NameRequiredDescriptionDefault
usdgYesUSDG to spend, all of it, in whole units as a decimal string, like "1.5"
symbolYesA stock on Borro by its ticker, like NVDA or AAPL (markets lists every one)
walletYesThe wallet's address (0x...); the transactions are built for it to sign
slip_bpsNoMost the price may move against the quote, in hundredths of a percent (default 50, 0.5%)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior5/5

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

With readOnlyHint=true already covering the safety profile, the description still adds substantial behavior beyond annotations: exact-in fill semantics (all USDG spent, at least quote minus slip_bps, or nothing spent), Borro's fee embedded inside the swap with fee_usdg/fee_bps in the quote, and the required approval chain (USDG→Permit2, then Permit2 allowance for Universal Router, lapsing after 30 minutes). It also discloses that pricing is current and the transaction set is simulated in order from the wallet. Nothing here contradicts the read-only/idempotent hints since the tool only prepares unsigned transactions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first clause, and most sentences carry non-redundant operational detail. It is dense and slightly meandering in places ("the ones Borro's short desk trades on", the trailing "simulated from the wallet in order"), but no sentence is padding.

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 four-parameter preparation tool with no output schema, this covers fill semantics, fee handling, approval prerequisites, and approval expiry. The residual gap is the exact shape of the returned quote/transactions, which is implied (fee_usdg, fee_bps) but not spelled out, and no mention of account prerequisites.

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 100%, so the schema already documents all four parameters, establishing a baseline of 3. The description does add real meaning for two of them: usdg is exact-in (all of it is spent) and slip_bps bounds the worst acceptable fill, but symbol and wallet get no elaboration beyond the schema.

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?

"Unsigned transactions for a plain spot buy" states a specific verb and resource, and the follow-up enumerates the exact mechanics (wallet USDG → stock token via Uniswap pools → token lands in wallet). The explicit negations "No loan, no leverage, no Borro contract" carve it away from the leverage/borrow family, though no sibling tool is named as the alternative.

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 implied rather than stated: "plain spot buy" plus the negation of loan/leverage tells an agent this is the unlevered path, and "supply lends it afterwards if it should earn lending fees" hints at a follow-on step. There is no explicit when-to-use/when-not pair or named alternative (e.g., the ETH-funded or leveraged buy variants).

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