Skip to main content
Glama

NEARpedia

find_code_examples

NEAR code examples on a topic from docs.near.org and gov.near.org, each code block run through check_code first: examples on live APIs come first, and a block that uses something removed or deprecated is listed after them with what in it is stale. Use for "show me how to call a contract from near-api-js", "cross-contract call in Rust".

Input Schema

NameRequiredDescriptionDefault
limitNoMost examples to return (default 4).
topicYesWhat the code should do or use, e.g. "ft_transfer_call", "cross contract call", "near-api-js view function".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/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 does real work: it discloses that every code block is run through check_code first, that live-API examples rank ahead of stale ones, and that deprecated blocks are returned with an indication of what is stale. It omits return-shape details (e.g. whether source URLs or the check_code verdict are included), which keeps it from a 5.

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?

Two sentences with no filler and the source scope front-loaded. The first sentence is overloaded, stacking the check_code pipeline and the ranking rule into one long clause chain, which makes it slower to parse than it needs to be.

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 two-parameter read-only lookup with no output schema and no annotations, the description covers sources, validation, ordering, and stale markup — enough for an agent to call it correctly and interpret ordering. Minor gap: it does not say what a returned example looks like beyond the ordering rule.

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 coverage is 100%, so both parameters are already documented, and the description adds only indirect guidance via its quoted topic phrasings. The limit parameter and its interaction with filtering (are stale examples counted toward the limit?) are not addressed at all.

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?

States a specific verb and resource ('find code examples') plus the exact corpora searched (docs.near.org and gov.near.org), which distinguishes it from the generic search/semantic_search/get_doc siblings. It also names check_code as an internal validation step, so an agent knows this is a curated-example tool, not a raw search.

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

Usage Guidelines4/5

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

Quoted example queries ('show me how to call a contract from near-api-js', 'cross-contract call in Rust') make the intended use case concrete and easy to match against a user request. It stops short of explicit exclusions — it never says to use get_doc or semantic_search instead when the user wants prose rather than runnable code.

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.