Skip to main content
Glama

how_do_i

Quickly retrieve the top 1-2 code snippets for any task with a specific library, including gotchas, to avoid reading entire documentation.

Instructions

Return the 1-2 best code snippets for a task with a library, plus the gotcha for each. Snippets are correct for the indexed version. Far cheaper in tokens than a docs dump.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesWhat you want to do, e.g. "retry a failed request"
libraryYesLibrary name as published on npm or PyPI
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses a key behavioral caveat: 'Snippets are correct for the indexed version,' warning that they may not be correct for other versions. It also mentions the gotcha per snippet and the token cost, adding useful context beyond a simple description. It does not cover error cases or exact response format, but it provides meaningful behavioral insight.

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 three tight sentences, front-loaded with the action and result. Each sentence earns its place: the first states what the tool returns, the second adds the critical version accuracy caveat, and the third gives a cost efficiency reason. There is no fluff or redundancy.

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?

The tool is simple with only two well-documented parameters, and no output schema exists. The description adequately explains the return content: 1-2 best snippets and their gotchas. Given the tool's simplicity, it provides a sufficient overview, though it could mention the response structure or ordering. It feels complete for the use case.

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%, meaning both parameters (library and task) are already fully documented in the schema. The description reinforces their semantics by saying 'for a task with a library' but provides no additional format, syntax, or usage details beyond what the schema already states. Thus, the baseline 3 is appropriate.

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 uses the specific verb 'Return' and names the resource: '1-2 best code snippets for a task with a library.' It also adds a distinctive detail about the 'gotcha for each.' However, unlike the TDQS 4.3 example, it does not explicitly distinguish itself from sibling tools like pick_library or docs_link, though the function is clear.

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?

The description implies when to use the tool: when you have a specific library and task. It also gives a practical guideline by noting it is 'far cheaper in tokens than a docs dump,' which helps the agent decide between this and a documentation lookup. It lacks explicit exclusions or alternative tool mentions, but the context is 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/mrkeyoor/should-i-use'

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