Skip to main content
Glama

Find Real-World Code Examples

gt_examples
Read-onlyIdempotent

Search GitHub for real-world usage examples of any library or pattern. Returns code snippets from popular 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)
Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true. The description adds valuable context beyond these: it requires a GT_GITHUB_TOKEN env var for higher rate limits (5000 req/hr vs 60 unauthenticated) and clarifies the data source is open-source GitHub repositories. It does not detail error handling when the token is missing, but overall it adds significant 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 very concise: two sentences in the first paragraph and two in the second. Every sentence adds value: purpose, differentiation from sibling, environment variable requirement, and source. No redundant or extraneous information. It is well-structured and front-loaded with the core purpose.

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's complexity (search over GitHub with rate limiting and library differentiation), the description covers all necessary context: what it does, when to use it, alternative tool, authentication/env var requirement, source of data, and a note on rate limits. Even without an output schema, the description provides enough for an agent to understand the tool's behavior and constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for all 4 parameters, so the baseline is 3. However, the description adds concrete examples for 'library' (e.g., 'drizzle-orm', 'fastapi') and 'pattern' (e.g., 'middleware', 'useMutation'), which help clarify the intended use of these parameters beyond the schema descriptions. This extra context justifies a 4.

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 it searches GitHub for real-world usage examples of libraries or patterns, with specific verb 'Search' and resource 'GitHub'. It explicitly distinguishes itself from the sibling tool gt_snippets, which covers library's own documentation. The title 'Find Real-World Code Examples' also aligns well.

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 provides explicit guidance on when to use this tool: 'Use this when you want to see how real projects use a library.' It also tells when not to use it by pointing to an alternative: 'For code snippets extracted from the library's own documentation, use gt_snippets instead.' This makes the usage context very clear.

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