Skip to main content
Every MCP tool definition supports a _meta field for platform-level configuration that sits alongside inputSchema and outputSchema. This guide covers the three _meta capabilities:
Optional contributor-side search helpers are not a new _meta contract in this rollout. If your venue needs the LLM-backed pattern described in Optional Contributor Search Helpers, keep that logic and any helper-private state inside the contributor. Standardized helper evidence now rides in contributor searchMetadata payloads and developer traces, not in ad hoc _meta.searchHelper fields.

Rate-Limit Hints

Use this section if your MCP server wraps APIs with strict quotas (hobby/free tiers, burst limits, or expensive fan-out endpoints).

Why This Exists

In the marketplace, each contributor has different upstream constraints. Without pacing hints, an agent can generate loops that are valid code but operationally unsafe for your API key tier. Publishing _meta.rateLimit (or _meta.rateLimitHints) gives Context two things:
  • Better execution choices (prefer batch/snapshot tools, avoid risky fan-out patterns)
  • Safer runtime pacing (respect cooldowns and concurrency intent)
This reduces avoidable 429/timeout loops and improves first-pass completion.

Metadata Shape

Add these fields to each tool definition under _meta.rateLimit:

TypeScript Example

Python Example

Contributor Guidance

  • Publish hints per tool, not only globally. Heavy fan-out endpoints and lightweight snapshot endpoints should have different guidance.
  • Keep maxConcurrency conservative for expensive or quota-sensitive endpoints.
  • Populate recommendedBatchTools whenever you offer a better aggregation endpoint.
  • Treat notes as execution guidance for real-world constraints (for example, “call alone”, “use shallow scan first”).
These hints are not a substitute for server-side protections. Keep your own upstream safeguards (timeouts, retries, and pacing) in the MCP server.

Rate-Limit Reference Implementations


Context Injection

The Context Injection pattern enables MCP tools to receive user-specific data without handling authentication or credentials:
  • Portfolio Data: Hyperliquid positions, balances, P&L
  • Prediction Markets: Polymarket positions and orders
  • Wallet Data: EVM addresses and token balances
Why “Context Injection”? The platform fetches user data client-side and injects it directly into your tool’s arguments. Your server never sees private keys or credentials, just structured data ready to analyze.

When to Use Context Injection

User-specific vs. Public Data: Use Context Injection when your tool needs to answer “my” questions. For public data (e.g., “What’s the ETH price?”), you don’t need context injection, just fetch it directly.

Quick Start (TypeScript)

1. Declare Context Requirements

Add _meta.contextRequirements to your tool definition:

2. Handle the Injected Data

The platform injects the data as the portfolio argument:

Quick Start (Python)

1. Declare Context Requirements

2. Handle the Injected Data

How It Works

Supported Context Types

"hyperliquid": Perpetuals & Spot

Hyperliquid portfolio data for perpetual and spot positions.
Data Source: Fetched from the public Hyperliquid Info API using the user’s linked wallet address.

"polymarket": Prediction Markets

Polymarket positions, orders, and market data.

"wallet": Generic EVM Wallet

Basic wallet data for any EVM-compatible chain.

Multiple Context Types

Your tool can request multiple context types:
Naming Convention: When requesting multiple contexts, the platform injects each with a descriptive key (e.g., hyperliquidPortfolio, walletPortfolio). Check your tool’s argument names match what you declare in inputSchema.

Context Injection Best Practices

The user might not have linked the required account, or they might have empty positions:
A linked wallet with no positions is valid, don’t treat it as an error:
Make it clear in your tool description that portfolio data is required:
Your analysis results should be machine-readable:

Security Model

Zero Credential Exposure: Your MCP server never sees private keys, API secrets, or wallet signatures. The platform fetches public data client-side and passes only the structured result to your tool.

Future Context Types

Beyond Crypto: The Context Injection system is designed to support any type of user data. We’re starting with high-value crypto data, but the architecture supports identity, preferences, and external service data.
Planned context types (not yet available):
Want a specific context type? Open an issue describing your use case and the data you need.

Complete Example: Portfolio Analyzer


Pricing & Execute Mode Eligibility

Most contributors start here: If you just want your tool available in the Context app (Query mode), you don’t need to configure anything in this section, set a listing response price when you register and you’re done. This section is for contributors who also want SDK developers to call their methods directly with per-call pricing (Execute mode).

How Query and Execute Work

Context runs one marketplace with two modes:
SDK consumers can use both modes. Use client.query.run() when you want Context to be the librarian (answer_with_evidence or evidence_only, pay-per-response). Use client.tools.execute() when your agent is the librarian (raw data, per-call pricing, spending limits). See TypeScript SDK or Python SDK.
Execute pricing is typically ~1/100 of listing response price because a single Query response can invoke up to 100 method calls internally. When developers pay per call, they need proportionally lower prices.

Metadata Shape

Add these fields to each method definition under _meta:

Execute Eligibility Rule

Hard gate: A method is Execute-eligible only when it has an explicit _meta.pricing.executeUsd value. There is no fallback to listing-level pricing for Execute calls.
  • Methods with _meta.pricing.executeUsd → visible in both Query and Execute (depending on surface field)
  • Methods without _meta.pricing.executeUsdQuery-only: invisible to SDK Execute discovery

Default Execute Price (Contributor Shortcut)

When you list your tool on the marketplace, you can set a single default execute price in the contribute form. This convenience input fans out to every method’s _meta.pricing.executeUsd at ingestion time. You don’t need to edit each method individually unless you want per-method overrides.

TypeScript Example

Python Example

Choosing a Mode

Execute is not only normalized data. Two kinds of method belong on the Execute surface. The first is normalized raw data (prices, candles, funding). The second is a functional primitive: any tool whose buyer is an agent that wants to call a function and use the result directly, such as fetch-and-clean a page, extract structured records, or search docs. For methods that perform a write or authed action, set surface: "execute" and implement the Handshake Architecture for the signature, transaction, or OAuth step.
Mixed listings are supported. A single tool can have some methods for Query only (curated intelligence tools), some for Execute only (streaming, raw data, or functional/action primitives), and some for both. The platform routes each method based on its individual metadata.
Visibility is bidirectional. The platform gates visibility in both directions:
  • No execute price → invisible in Execute. Methods without _meta.pricing.executeUsd will not appear in SDK Execute discovery (client.tools.execute()). They remain Query-only.
  • Execute-only → invisible in Query. Methods with surface: "execute" and queryEligible: false will not appear in the Context app or client.query.run(). The runtime will never select them for answer synthesis. They are SDK-only.
Design your surface and queryEligible settings intentionally, they control where your tool shows up.

Choosing Eligibility With The Code Interpreter

Query mode includes a managed code_interpreter tool that runs Python in an isolated Vercel Sandbox microVM with pandas, numpy, scipy, matplotlib, statsmodels, and pyarrow available (see Code Interpreter for the full data flow contract). After the runtime calls your MCP methods, the interpreter can turn raw structured outputs into derived metrics, structured chart artifacts, matplotlib PNG visualisations, markdown-ready tables in the synthesized answer, rolling statistics, correlations, drawdowns, and other post-processed evidence. That changes the default choice for high-quality read methods. In the pre-interpreter model, a method that returned raw time-series data might have looked useful only for SDK Execute callers. In the current Query runtime, that same method can be first-class answer evidence because Context can compute the derived analysis after retrieval. The interpreter operates only on data your method already returned. It does not make HTTP, network, or marketplace calls of its own — networkPolicy: "deny-all" is enforced at the platform level — so methods that return portable structured data are first-class answer fuel, while methods that withhold the underlying data and only return a polished narrative leave the interpreter unable to compute on top. Use this rule of thumb:
If a read method can produce portable structured data that a Python analyst (with pandas + numpy) could compute over, prefer surface: "both" and queryEligible: true. The method does not need to return a polished narrative; the managed librarian and the Python code_interpreter can derive the final answer.

Pricing Guidance

The ~1/100 ratio is guidance, not a protocol-enforced rule. A Query response can make up to 100 method calls in one turn, so execute pricing per call should be proportionally lower.

Legacy Tools (No _meta)

Tools listed before this metadata rollout continue working in Query with unchanged economics. They receive default metadata at ingestion time:
To enable Execute visibility for a legacy tool, either set a default execute price in the Developer Tools page or add _meta.pricing.executeUsd to your MCP server code and click “Refresh Skills”.

Reference Implementation

For a production example of _meta pricing and rate-limit metadata, see the Normalized Data Provider. For a large-surface contributor with 20+ methods and complex schemas, see the Polymarket contributor server. The following _meta capabilities are recommended for production tools with upstream API constraints:
  • Per-method _meta.pricing.executeUsd with a default fallback and explicit opt-out for query-only methods
  • Per-method _meta.rateLimit hints built from upstream API tier constraints
  • Batch tool recommendations via recommendedBatchTools

Handshake Architecture

For write actions: signatures, transactions, OAuth

Build & List Your Tool

Complete guide to building MCP tools