Guide
Designing low-token MCP tools for sports data
Short answer: an agent pays for every byte a tool sends back, and for the tool list itself. We keep MCP tools cheap with fixed credit tiers, an estimate-only mode for variable prices, hard page caps, summary objects instead of raw rows, and aggregate tools that answer a question in about 1.5 KB.
The two costs agents pay
An MCP server costs tokens in two places. The first is the tool list, which a client loads at the start of a session whether or not any tool is used. The second is the results, which land in the model's context every time a tool runs. Most design mistakes come from ignoring one of the two.
We measured both on our hockey server on December 6, 2026:
| Item | Size |
|---|---|
tools/list, 32 tools | 95,725 bytes, about 24,000 tokens at 4 bytes a token |
| Descriptions only | 16,023 characters |
One get_shot_map page of 2,000 rows | 380,726 bytes, about 95,000 tokens |
One get_prop_backtest answer over 7,561 rows | 1,550 bytes |
Two lessons follow. Descriptions are cheap and schemas are not, so the way to shrink the tool list is fewer parameters per tool, not shorter prose. And the gap between a page of rows and a summary is a factor of about 250. If an agent can answer its question from a summary, the rows should never leave the server.
Pattern 1: price every tool, and say the price where the model reads it
Every tool has a fixed credit price in tiers: 1 credit for reference lookups such as list_teams, 2 for schedules and standings, 5 for single-player or single-team views, 10 for play-by-play, shot maps, shifts and odds, and 25 for the heaviest queries such as full line history and backtests. The price is in the tool description and again in a table in the server instructions, next to a "tool selection" list that maps a plain question to a tool.
The reason is not billing alone. A model that sees "10 cr" beside get_plays and "2 cr" beside get_schedule picks the cheap tool first without being told. A price is the cheapest piece of guidance you can give. The same server also returns the amount charged in the response headers (X-Credits-Used, X-Credits-Remaining) and in the result metadata, so an agent can track its own spend.
Pattern 2: let the model ask the price first
Fixed tiers do not work when the cost depends on the arguments. A season of odds is billed per game returned, which is why one call can cost 1,000 credits. For those tools we added estimate_only. A call with estimate_only: true runs nothing and charges nothing, and answers with the cost.
On the live server, the check below found six tools whose input schema accepts estimate_only, and priced two calls:
import json, os, urllib.request
BASE = "https://mcp.puckapi.com"
KEY = os.environ["PUCKAPI_API_KEY"]
def post(path, body, headers=None):
req = urllib.request.Request(BASE + path, data=json.dumps(body).encode(),
headers={"Content-Type": "application/json", "Accept": "application/json, text/event-stream", **(headers or {})})
with urllib.request.urlopen(req, timeout=60) as resp:
raw = resp.read()
return resp.status, raw, resp.headers.get("x-credits-used")
# 1. What does an agent pay just to see the tools? tools/list needs no key and no credits.
status, raw, _ = post("/mcp", {"jsonrpc": "2.0", "id": 1, "method": "tools/list"})
text = raw.decode()
if text.startswith("event:"):
text = next(l[5:] for l in text.splitlines() if l.startswith("data:"))
tools = json.loads(text)["result"]["tools"]
print(f"HTTP {status}: {len(tools)} tools, {len(raw):,} bytes, about {len(raw)//4:,} tokens at 4 bytes a token")
# 2. Price a call before making it. estimate_only runs nothing and charges nothing.
with_estimate = [t["name"] for t in tools if "estimate_only" in t["inputSchema"]["properties"]]
print(len(with_estimate), "tools accept estimate_only, for example", with_estimate[:4])
for tool, body in [("get_odds", {"season": "20252026"}),
("get_player_props", {"player_id": 8481721, "from_date": "2026-11-01", "to_date": "2026-11-05"})]:
status, raw, used = post(f"/v1/{tool}", {**body, "estimate_only": True}, {"x-api-key": KEY})
print(f"HTTP {status} {tool}: {json.loads(raw)['data']}, credits charged {used}")
# get_shot_map has no estimate_only: its price is fixed, 10 credits a page.The run reported get_odds for a full season at 1,000 credits and a player's props across five days at 20. A tool with a fixed price does not need the flag, and adding it there would only grow the schema. Note that a tool called with estimate_only still has to satisfy its output schema. Our server solves that by registering a version of the output schema where every normal field is optional and the three estimate fields are added:
// Excerpt from our server source. Shown for the design, not executed here.
export function estimateTolerantOutput(shape) {
if (!shape) return shape
const out = {}
for (const [key, value] of Object.entries(shape)) out[key] = value.optional()
if (!("estimate_only" in out)) out.estimate_only = z.boolean().optional()
if (!("tool" in out)) out.tool = z.string().optional()
if (!("credits" in out)) out.credits = z.number().optional()
return out
}Pattern 3: cap pages, then paginate with a cursor
Every list-returning tool has a default page size and a hard maximum. get_shot_map defaults to 1,000 and caps at 2,000; get_player_game_log defaults to 100 and caps at 200. The response carries next_offset, null on the last page, and some tools use next_from_date instead. The server decides the cap, not the model, because a model asked for "all shots" will ask for all of them.
Prefer a cursor the model can pass back untouched over a page number it must compute. Make pages chronological and stable, so a retry returns the same rows.
Pattern 4: return a summary beside the rows
Each shot-map page includes a summary object next to shots: how many rows came back, the page size, the offset, a count by event type and a one-line note on the coordinate frame. An agent can read the summary, decide the page is not what it wanted, and stop, without parsing 2,000 rows. The note field carries caveats that otherwise live only in documentation, such as which way the attacking end flips between periods.
Put the caveat in the payload. A model that never read your docs will still see it.
Pattern 5: add an aggregate tool for the common question
The cheapest result is the one that is already computed. get_prop_backtest takes a market, a date range and filters, and returns counts, a rate, a 95 percent interval, a breakdown by season and a plain-language method note, in about 1.5 KB, without sending any of the 7,561 underlying rows. It is priced at 25 credits because it scans a lot, and it is worth it because the alternative is a long chain of 10-credit calls and a spreadsheet inside the context window. The tool's instructions tell the agent to report the sample size, the interval and the breakdown with every answer, and never to present a past result as a pick.
Design the aggregates from the questions people really ask, and keep the row-level tool for when they need to check.
Pattern 6: bound the inputs, not just the outputs
Our server rejects oversized arguments before any work: strings over 256 characters, arrays over 200 items, objects nested deeper than 4 levels and more than 64 keys. The request body is capped at 64 KB. The reason is practical. With 206 string parameters across the tools, an unbounded input is an easy way to waste memory or hide an injection payload in a field nobody reads.
Discovery calls (initialize, tools/list, ping) work without a key, because they do no metered work. A request batch may hold at most ten messages and at most one tool call, so one counted request cannot hide many.
Pattern 7: make retries free
Agents retry, and so do networks. Calls with the same x-request-id, tool and arguments inside a two-minute window are not charged twice. In a live check, one call charged 5 credits and the repeat charged 0. The window is bounded on purpose, because an unbounded key would let a caller poll fresh data forever for the price of one call. The pagination and retry guide shows the client side.
When not to use this
- You expose five tools. The tool-list cost is small, and tiers, estimates and summaries are extra moving parts. Start with caps and a clear description.
- Your results are already small. A summary field on a 20-row answer adds bytes and nothing else.
- You need exact token counts. Our figures divide bytes by four. That is an estimate, and a real tokenizer will give a different number, higher for dense JSON with numbers.
- Your users cannot see prices. Credit tiers only steer agents that can read them. If the client hides descriptions, enforce the limits on the server.
Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.