Skip to main content
Glama

Ejecutar código contra la API (Code Mode)

ejecutar

Corre JavaScript en un sandbox con un objeto api ya autenticado: una función async por tool, mismos parámetros y mismo resultado que llamarla directo. Ideal para lotes (validar 50 CBUs, armar 20 cronogramas) o para encadenar llamadas sin volver al modelo. El código puede usar await, console.log y return; el valor retornado vuelve en resultado. Costo: 1 crédito por ejecución + la suma de las llamadas internas. Máximo 100 llamadas y 15 s. Sin acceso a red, archivos ni módulos.

Funciones disponibles: api.normalizarDireccion({"direccion":"Av. Corrientes 1234","provincia":"CABA"}) → 2 crédito(s): Normalizar y geocodificar una dirección argentina api.ubicacion({"lat":-34.6037,"lon":-58.3816}) → 1 crédito(s): Geocodificación inversa: lat/lon → provincia, departamento y municipio api.buscarLocalidad({"nombre":"Rosario","provincia":"Santa Fe"}) → 1 crédito(s): Buscar localidades argentinas api.buscarCalle({"nombre":"Santa Fe","provincia":"CABA","categoria":"AV"}) → 1 crédito(s): Buscar calles en el callejero oficial api.buscarDivision({"tipo":"provincia","nombre":"cordoba"}) → 1 crédito(s): Buscar provincias, departamentos o municipios Costo: 1 crédito(s).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "codigo": "<codigo>"
    },
    "name": "ejecutar"
  }
}

Input Schema

NameRequiredDescriptionDefault
codigoYesJavaScript. Ej: const r = await api.validarCuit({cuit:'20-12345678-6'}); return r.valido;
timeout_msNoTiempo máximo total en milisegundos

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses the sandbox constraints (no network, files, or modules), the cost model (1 credit per run plus the sum of internal calls), and hard limits (100 calls, 15 s). It is only short of a 5 because it does not say how errors or exceptions surface, or whether internal calls still bill when execution fails or times out.

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?

Well front-loaded: purpose, then usage, then runtime behavior, then cost and limits, then the API surface. The function catalog is long but earns its place as the actual callable surface; a trailing duplicated 'Costo: 1 crédito(s).' fragment reads as a templating artifact and is the only waste.

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?

There is no output schema, so the description must explain the return value and it does via `resultado`; costs, limits and sandbox boundaries are all covered for a fairly complex execution tool. The remaining gap is failure semantics (timeout behavior, error propagation, partial billing), which an agent would want before writing a large batch.

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 real meaning beyond the schema: `codigo` may use await, console.log and return, and the return value surfaces in `resultado`, which the schema never states. The function catalog with per-call signatures and credit costs further defines what `codigo` can legitimately contain.

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: run JavaScript in a sandbox that exposes a pre-authenticated `api` object with one async function per tool. It also distinguishes itself from the sibling tools by framing itself as the batch/chaining wrapper whose functions behave identically to calling them directly.

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 names the conditions that select this tool over direct calls: batches (validating 50 CBUs, building 20 schedules) and chaining calls without returning to the model. The phrase 'mismos parámetros y mismo resultado que llamarla directo' makes the alternative and its equivalence unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources