Skip to main content
Glama
lzinga

US Government Open Data MCP

code_mode

Read-only

Post-process a tool's output with custom JavaScript to get only the data you need. Runs in a sandbox; returns only console.log results.

Instructions

Run a JavaScript processing script against any tool's output in a WASM sandbox. Calls the specified tool first, then runs your script with the raw response as DATA (string). Only your script's console.log() output enters context — typically 65-99% smaller.

USE THIS when you need specific fields, counts, or filters from a large response. DO NOT use this when you need to read and interpret the full data for cross-referencing or analysis.

The script can: JSON.parse(DATA), use loops/map/filter/reduce, Math, string ops, console.log(). The script CANNOT: access files, network, Node.js APIs, or import modules.

Example — count serious reactions for a drug: tool='fda_drug_events', tool_args={"search":"patient.drug.openfda.brand_name:aspirin","limit":100}, code='const d=JSON.parse(DATA);const data=d.data||d;const items=data.items||data.results||[];' + 'const counts={};items.forEach(r=>{const rxs=r.reactions||[];rxs.forEach(rx=>{counts[rx]=(counts[rx]||0)+1})});' + 'Object.entries(counts).sort((a,b)=>b[1]-a[1]).slice(0,10).forEach(([k,v])=>console.log(k+": "+v))'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolYesName of the MCP tool to call (e.g. 'fda_drug_events', 'fred_series_data', 'congress_search_bills')
tool_argsNoArguments to pass to the tool, as a JSON object (e.g. {"search": "serious:1", "limit": 50})
codeYesJavaScript code to process the result. The tool's full response is available as DATA (string). Use JSON.parse(DATA) to parse it. Use console.log() to produce output. Only console.log output is returned — keep it concise.
Behavior4/5

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

Beyond readOnlyHint, description details sandbox constraints (no file/network), script capabilities, and output size reduction. No contradictions.

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-structured with front-loaded purpose, clear sections, and concise language, though the example is lengthy but necessary for clarity.

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?

Despite no output schema, the description covers all aspects: purpose, usage, capabilities, limitations, and a concrete example, making it fully actionable.

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

Parameters5/5

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

Schema coverage is 100%, but description adds significant meaning: explains tool as MCP tool name, tool_args as JSON object, code as JavaScript with DATA variable, and provides a detailed example.

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 runs a JavaScript processing script against tool output in a WASM sandbox, distinguishing it from sibling data retrieval tools. Provides a concrete example.

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 specifies when to use (filtering, counting) and when not to use (full data cross-referencing), with clear alternatives implied.

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/lzinga/us-gov-open-data-mcp'

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