Skip to main content
Glama

Search Foods

search_foods
Read-onlyIdempotent

Search USDA Food Data Central for food items by name, brand, or ingredient. Supports filtering by data type (Branded, Foundation, SR Legacy, Survey FNDDS, Experimental) and brand owner. Returns FDC id, description, data type, and publication date per result.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "organic whole milk"
    },
    "name": "search_foods"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesFree-text, name / brand / ingredient
sort_byNodataType.keyword | lowercaseDescription.keyword | fdcId | publishedDate (default relevance)
data_typeNoFilter to data type(s). Comma-sep. Options: Branded | Foundation | Survey (FNDDS) | SR Legacy | Experimental
page_sizeNo1-200 (default 50)
sort_orderNoasc | desc
brand_ownerNoRestrict to a brand owner
page_numberNo1-based page (default 1)

Output Schema

NameRequiredDescriptionDefault
foodsNoArray of food items matching search
totalHitsNoTotal number of matching foods
currentPageNoCurrent page number
foodSearchCriteriaNoSearch criteria used

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"Free-text — name / brand / ingredient"New value: +"Free-text, name / brand / ingredient"
  2. Changed2 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "query": "organic whole milk"
      +  },
      +  {
      +    "brand_owner": "Perdue",
      +    "page_size": 25,
      +    "query": "chicken breast",
      +    "sort_by": "publishedDate",
      +    "sort_order": "desc"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Search results from USDA FDC food items",
      +  "properties": {
      +    "currentPage": {
      +      "description": "Current page number",
      +      "type": "number"
      +    },
      +    "foodSearchCriteria": {
      +      "description": "Search criteria used",
      +      "type": "object"
      +    },
      +    "foods": {
      +      "description": "Array of food items matching search",
      +      "items": {
      +        "properties": {
      +          "dataType": {
      +            "description": "Type of food data (Branded, Foundation, etc.)",
      +            "type": "string"
      +          },
      +          "description": {
      +            "description": "Food description",
      +            "type": "string"
      +          },
      +          "fdcId": {
      +            "description": "FDC food identifier",
      +            "type": "number"
      +          },
      +          "publishedDate": {
      +            "description": "Date food was published",
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "totalHits": {
      +      "description": "Total number of matching foods",
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnly=true, idempotent=true, destructive=false and openWorld=true, so the safety profile needs no restatement. The description adds some context by enumerating the supported data types and the returned fields, but since the output schema already defines the return shape, the net new behavioral information is modest.

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?

Two sentences, purpose first, capabilities second, with no filler or hedging. Slight redundancy with the schema on data types and returned fields keeps it from a 5, but it is tightly front-loaded.

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 annotations covering the safety profile and an output schema covering returns, the description supplies the remaining essentials: data source, query dimensions, and filter set. Only cross-tool routing against siblings is absent, which is a minor gap for a 7-parameter search tool.

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 100%, so every parameter including sort_by, page_size, page_number, data_type and brand_owner is already documented. The description mentions data type and brand owner filtering but adds no syntax, defaults, or edge-case detail beyond what the schema states, making the 3 baseline correct.

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?

The description gives a specific verb and resource ('Search USDA Food Data Central for food items') plus the query dimensions (name, brand, ingredient). That is far more precise than a tautology, but it never contrasts itself with nearby tools such as get_food or list_foods, so an agent must infer the boundary.

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 implied by the purpose and the available filters, which gives an agent a reasonable sense of when a free-text food lookup applies. There is no explicit when-to-use/when-not-to-use statement and no named alternative for retrieving a single known food, so guidance stays at the implied level.

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.