Skip to main content
Glama

find_code_examples

Read-onlyIdempotent

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".

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": {
      "topic": "<topic>"
    },
    "name": "find_code_examples"
  }
}

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/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, so the safety profile is free. The description adds real behavior beyond that: every code block is passed through check_code, live-API examples are ranked first, and deprecated examples are appended with an explanation of what is stale. It stops short of describing result size behavior or source-mixing, but the ranking and validation pipeline is genuinely informative.

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?

Front-loaded with the resource and sources, then ranking behavior, then usage examples. The first sentence is a long colon-and-comma chain that takes a second read, but no sentence is filler.

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

Completeness5/5

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

With only two parameters, full schema coverage, annotations present, and no output schema, the description covers what the agent needs: what is searched, where, how results are ordered, and how staleness is surfaced. Nothing material to correct invocation is missing.

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%, with both 'topic' and 'limit' documented including bounds and a default, so the schema carries the load. The description's example queries loosely illustrate good topic values but add no format or constraint detail beyond the schema, so the baseline 3 applies.

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?

States a specific resource (NEAR code examples) and names the two sources, docs.near.org and gov.near.org, plus the validation step via check_code. It is distinguishable from get_doc or semantic_search by the explicit 'code block' framing, though it never names a sibling to contrast with.

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?

Provides two concrete example requests ('show me how to call a contract from near-api-js', 'cross-contract call in Rust') that clearly delimit the intended query shape. It does not state when to use an alternative such as semantic_search or get_doc instead, leaving that inference to the agent.

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