Skip to main content
Glama

Generar snippet de un endpoint

generate_snippet
Read-only

Creates ready-to-use curl, JavaScript fetch, or Python requests snippets for an API endpoint, identified by operationId or method+path, with API key placeholders.

Instructions

Devuelve un snippet de código listo para usar (curl, JavaScript fetch o Python requests) para un endpoint, idéntico al de la web. Identificá el endpoint por operationId o por method+path. Los valores de API Key son placeholders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langYesLenguaje del snippet.
pathNoPath relativo, ej. '/products'.
methodNoMétodo HTTP. Usar junto con path.
versionNoVersión de la API a consultar. Default "v2" (la doc canónica y recomendada). Usá "v1" SOLO para integraciones legadas que siguen en /api/v1.
operationIdNoEj. 'v2-products-create'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the description only needs to add context beyond that. It usefully warns that API key values are placeholders and that output matches the website snippet, which preempts an agent treating the snippet as runnable with real credentials.

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?

Three short sentences, front-loaded with the return value, then identification method, then the credential caveat. No filler, though the phrase 'idéntico al de la web' is slightly decorative.

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?

With no output schema, the description correctly states that the return is a ready-to-use code snippet and notes the placeholder credentials. Version defaults and legacy guidance are already covered in the schema, so the remaining gap is minor.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds the genuinely useful fact that identification is an either/or choice between operationId and method+path, a constraint the schema leaves implicit. The lang enum values are left to the schema, which is fine.

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?

States a specific verb and resource ('Devuelve un snippet de código listo para usar') plus the exact output formats (curl, JavaScript fetch, Python requests), which no sibling tool produces. An agent can distinguish it from get_endpoint or get_openapi immediately.

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?

Explains the two accepted identification modes ('Identificá el endpoint por operationId o por method+path'), which is real routing guidance. It does not say when to prefer this over siblings like get_endpoint or get_openapi, so it stops short of a 5.

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