Skip to main content
Glama

metri: Calorie & Macro Tracker

Search saved foods

metri_search_foods
Read-onlyIdempotent

Search the user's private metri library of saved foods and cooked batches. It reads only metri state, not the public web.

Pass at most one field:

  • foodId: read that one food in full; a batch includes its components.

  • query: search food names. Returns up to 20 matches in relevance order.

  • cursor: fetch the next 20 results of the previous search or browse.

  • nothing: browse the whole library, most recently changed first, 20 at a time.

Search and browse results omit batch components and include nextCursor when more results exist.

Search when the user refers to something personal or saved, such as their usual dish, a cooked batch or a specific product, and log with its foodId when it is the same food. Generic foods can be logged inline without a search.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "metri_search_foods"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNoKey words from the food's name in the user's language, such as "chicken curry". Foods containing any of the words come back, best matches first; the last word also matches as a prefix.
cursorNonextCursor from the previous response, to get the next page. It already carries that search, so send it without query.
foodIdNoID of one saved food from an earlier metri result. Returns only that food, in full, including a batch's components.

Output Schema

NameRequiredDescriptionDefault
foodsYes
nextCursorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, closed-world), it discloses pagination size (20 at a time), that search and browse omit batch components, that foodId returns a batch's components in full, and that nextCursor signals more results. These are result-shaping behaviors an agent could not infer from the annotations or output schema alone.

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?

Front-loaded scope statement, then a scannable bulleted breakdown of the four invocation modes, then the decision rule. Every sentence carries information; nothing is redundant filler.

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?

An output schema exists, so the description need not explain return shapes, yet it still notes nextCursor and component omission where it affects agent decisions. For a 3-param, zero-required read tool the definition covers purpose, modes, and routing completely.

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?

With 100% schema coverage the schema already documents each argument's format, so the baseline is 3. The description adds genuine meaning: the mutual-exclusivity rule ('Pass at most one field'), the mode implied by passing nothing, and the relevance/prefix matching outcome for query. It does repeat some cursor semantics already present in the schema, which keeps it just short of 5.

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 ('Search the user's private metri library of saved foods and cooked batches') and immediately scopes it against the alternative of web search ('It reads only metri state, not the public web'). The distinction from siblings like metri_log_consumption and metri_save_food is implicit but clear from the personal-library framing.

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 says when to search ('when the user refers to something personal or saved, such as their usual dish, a cooked batch or a specific product') and when not to ('Generic foods can be logged inline without a search'). It also routes to the right mode with a per-argument list, including the empty-args browse case.

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