Skip to main content
Glama

Find Real-World Code Examples

gt_examples
Read-onlyIdempotent

Search GitHub for real-world code examples of any library or pattern. Returns snippets from open-source projects with repository attribution.

Instructions

Search GitHub for real-world usage examples of any library or pattern. Returns code snippets from popular open-source projects with repository attribution.

Requires GT_GITHUB_TOKEN env var for higher rate limits (5000 req/hr vs 60 unauthenticated).

Source: open-source GitHub repositories (not the library's own docs). Use this when you want to see how real projects use a library. For code snippets extracted from the library's own documentation, use gt_snippets instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
libraryYesLibrary or package name to find examples for, e.g. 'drizzle-orm', 'tanstack/query', 'fastapi'
patternNoSpecific usage pattern to search for, e.g. 'middleware', 'useMutation', 'auth guard'
languageNoProgramming language filter: 'typescript', 'python', 'rust', 'go'
maxResultsNoNumber of code examples to return (default: 5, max: 10)
Behavior5/5

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

Annotations already declare read-only, idempotent, open-world. Description adds required env var for higher rate limits (5000 vs 60) and source type, providing valuable context without contradiction.

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 paragraphs: first states purpose and output, second clarifies source and rate limits. Front-loaded and clear, though could be slightly more compact.

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?

Given annotations and schema coverage, description is adequate. Explains source and rate limits. Lacks return format details but not critical for a search tool.

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 covers 100% of parameters with descriptions. Description adds marginal value (e.g., default for maxResults) but does not significantly enhance understanding beyond schema.

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?

Clearly states it searches GitHub for real-world usage examples of libraries/patterns, returns code snippets with attribution. Distinguishes from sibling gt_snippets which uses library's own docs.

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

Usage Guidelines5/5

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

Explicitly says when to use (want real project examples) and when not (use gt_snippets for library's own docs). Names alternative tool directly.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rm-rf-prod/GroundTruth-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server