Skip to main content
Glama
USDA NASS MCP Server

USDA NASS MCP Server

by kin5

get_db_record_count

Count database records for a specific commodity, location, and time to quickly check data availability before retrieval.

Instructions

Get the number, or count, of database records of a given commodity for a location and time.

Args:
    query: Dictionary with three keys, "commodity", "location", and "time", each with a dictionary of parameter and value pairs.

Returns:
    A JSON string containing one key, "count", and a value of the number of records or an error message.

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": {
      "query": "<query>"
    },
    "name": "get_db_record_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden, and it partially does: it discloses that the return is a JSON string with a 'count' key or an error message. It says nothing about permissions, failure conditions, or whether an empty match returns 0 versus an error.

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?

Short and front-loaded: one sentence for purpose, then explicit Args and Returns blocks. The Returns section partly duplicates the existing output schema, which is the only mild waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete at the top level but thin relative to the deeply nested query schema with zero field-level descriptions, where an agent must guess which of the many location, commodity, and time sub-fields to populate. The output schema offsets the need to explain return values, but the input side remains under-explained.

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 0%, so the description is the only prose available, and it contributes the useful structural fact that query is a dict of three keys, each mapping to a dict of parameter/value pairs. However, it explains none of the ~30 nested filter fields (zip_5, asd_code, year, freq_desc, commodity_desc, etc.), nor which combinations are valid or how the three time variants are chosen among.

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?

States a specific verb and resource — the count of database records — plus the three filter axes (commodity, location, time). An agent can tell this is a counting tool rather than a data-fetching tool, though it never names or contrasts with get_full_dataset.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: the description's emphasis on 'the number, or count' suggests it should be used when only a record total is needed. There is no explicit when-to-use, no exclusion, and no pointer to get_full_dataset for retrieving actual records.

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