Skip to main content
Glama
lzinga

US Government Open Data MCP

code_mode

Process US government data tool outputs with JavaScript to extract specific fields, counts, or filters, reducing response size by focusing only on needed information.

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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it runs in a WASM sandbox for security, processes tool output, only returns console.log() output (typically 65-99% smaller), and details script capabilities (JSON.parse, loops, Math, string ops) and restrictions (no file/network/Node.js/module access). It lacks explicit mention of error handling, performance limits, or authentication needs, but covers core operational traits well.

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 well-structured and concise. It front-loads the core purpose, follows with usage guidelines, then details behavioral aspects and parameters with a practical example. Every sentence adds value—no wasted words—and the example is directly illustrative. The length is appropriate for a complex, multi-parameter tool.

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?

Given the tool's complexity (3 parameters, no annotations, no output schema), the description is largely complete. It covers purpose, usage, behavior, and parameters with examples. However, it lacks details on error responses, sandbox limitations (e.g., memory/timeouts), or output format specifics, which could aid the agent in robust invocation. The example compensates but doesn't fully address all contextual gaps.

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 description coverage is 100%, so the baseline is 3. The description adds significant value beyond the schema: it explains that 'tool' is the name of an MCP tool to call, provides an example ('fda_drug_events'); clarifies 'tool_args' as JSON arguments with an example; and details 'code' as JavaScript that processes DATA, with capabilities/restrictions and a full example script. This enriches parameter understanding, though it doesn't fully compensate for all possible edge cases.

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 the tool's purpose: '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).' It specifies the verb ('Run'), resource ('JavaScript processing script'), and mechanism ('against any tool's output'), distinguishing it from all sibling tools which are data retrieval tools, not processing utilities.

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 usage guidelines: '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.' It clearly defines when to use the tool (for extraction/filtering) and when not to use it (for full analysis), offering direct alternatives by implication (use other tools directly for full data).

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-government-open-data-mcp'

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