Skip to main content
Glama

Find Real-World Code Examples

gt_examples
Read-onlyIdempotent

Find real-world GitHub code examples of a library or pattern, with repo links, to see how others implement it. Returns doc snippets when no GitHub token is set.

Instructions

Real-world usage of a library or pattern from public GitHub code, with repo links (needs GT_GITHUB_TOKEN, else official-docs examples). Snippets from the library's own docs: gt_snippets.

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": {
      "library": "<library>"
    },
    "name": "gt_examples"
  }
}

Input Schema

NameRequiredDescriptionDefault
libraryYes
patternNoe.g. 'useMutation'
languageNoe.g. 'typescript'
maxResultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv8.1.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / language / description
      Previous value: -"Programming language filter: 'typescript', 'python', 'rust', 'go'"New value: +"e.g. 'typescript'"
    • removedInput schema / properties / library / description
      Removed value: -"Library or package name to find examples for, e.g. 'drizzle-orm', 'tanstack/query', 'fastapi'"
    • removedInput schema / properties / maxResults / description
      Removed value: -"Number of code examples to return (default: 5, max: 10)"
    • changedInput schema / properties / pattern / description
      Previous value: -"Specific usage pattern to search for, e.g. 'middleware', 'useMutation', 'auth guard'"New value: +"e.g. 'useMutation'"
  2. First observedv5.2.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, openWorld, idempotent and non-destructive, so safety is covered. The description adds real behavioral context the annotations cannot: the auth requirement (GT_GITHUB_TOKEN), the degraded output mode when unauthenticated, and the fact that results carry repo links. It does not mention rate limits or result-count behavior, which would be the next useful detail for an open-world search.

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 tight sentences with no filler; the core capability is front-loaded and the sibling pointer is placed second as a routing note. The telegraphic phrasing ('Snippets from the library's own docs: gt_snippets.') is compact but slightly clipped, which is the only thing keeping it from a 5.

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 read-only search tool with no output schema, the description covers source, output shape (repo links), auth requirement and degraded fallback. Additional detail on empty-result handling or result limits would round it out, but nothing essential for calling it correctly 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 50%, with meaningful descriptions only on pattern, language and maxResults examples, while the required library parameter is undocumented in both schema and description. The phrase 'a library or pattern' mirrors the parameter names but adds no format, matching, or scoping guidance. Baseline 3 fits given the partial schema coverage and no compensating detail.

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?

The description states the resource and source precisely: real-world usage of a library or pattern drawn from public GitHub code, returned with repo links. It also distinguishes itself from gt_snippets by naming the sibling as the docs-snippet source, so an agent can tell the two apart. It stops short of an explicit verb like 'search' or 'find', which keeps it out of the top band.

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?

Clear routing is given: use gt_snippets for snippets from the library's own docs, use this tool for real-world code from GitHub. The description also discloses the prerequisite (GT_GITHUB_TOKEN) and the fallback behavior when it is absent (official-docs examples), which tells the agent what to expect if auth is missing. There is no explicit when-not guidance beyond the sibling split.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.