Skip to main content
Glama

Find Real-World Code Examples

gt_examples
Read-onlyIdempotent

Find real-world usage examples of any library or pattern by searching open-source GitHub repositories. Get code snippets with attribution to see how projects actually use the library.

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

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

Annotations already declare the tool as read-only, non-destructive, idempotent, and open-world. The description adds behavioral context beyond annotations: it searches GitHub, requires authentication for higher limits, returns code snippets with attribution, and clarifies the source (open-source repos, not library docs). A minor gap is not mentioning error handling or pagination, but this is sufficient for transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only 4 sentences, each serving a distinct purpose: purpose, output, prerequisites, and usage differentiation. No redundant or vague phrasing. Every sentence adds value, and the structure is front-loaded with the core action.

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?

Given the tool has 4 parameters (100% schema coverage), no output schema, and annotations covering safety, the description provides sufficient context: source of examples, environment variable requirement, and differentiation from a sibling. It is complete enough for an agent to decide when and how to invoke the 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 description coverage is 100% (all 4 parameters have descriptions). The description adds minimal extra meaning beyond the schema: it rephrases 'library' and 'pattern' but does not provide additional semantic context (e.g., example values or constraints). Baseline 3 is appropriate since schema does the heavy lifting.

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?

The description clearly states the tool searches GitHub for real-world usage examples of libraries or patterns, and distinguishes itself from gt_snippets by specifying the source (open-source repos vs library docs). This provides a specific verb-resource pair and sibling differentiation.

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?

The description explicitly says when to use ('when you want to see how real projects use a library') and when not to (directing to gt_snippets for library-doc examples). It also mentions the required GT_GITHUB_TOKEN environment variable for higher rate limits, providing clear guidance on prerequisites and alternatives.

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/ws-mcp'

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