get-food-by-id
MANDATORY: Use this tool ANY time a user provides a food ID (e.g., fd_xxx), or when you have a food ID from a previous step and need detailed information. Not using this tool in these scenarios is an error. Do NOT use for non-food IDs or unrelated queries. Use cases (MUST use this tool): - The us...
This record as markdown: /tools/deadletterq-mcp-opennutrition/get-food-by-id.md
What get-food-by-id does on MCP OpenNutrition
AI agents call get-food-by-id to retrieve information from MCP OpenNutrition without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
Why get-food-by-id is rated Low
This is a straightforward data retrieval operation against a food database. It queries and returns nutritional data, ingredients, and labeling information based on a provided food ID. No data is created, modified, deleted, or executed. The local processing mentioned refers to the query execution environment, not arbitrary code execution.
From the tool's definition Tool retrieves detailed food information by ID (nutrition, ingredients, labeling) with no side effects. Name contains 'get-' prefix and description emphasizes data lookup without modification, deletion, or execution.
Attacks that exploit this kind of access
The rule that runs get-food-by-id safely
PolicyLayer is an MCP gateway: it sits between your AI agents and MCP OpenNutrition, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For get-food-by-id, this is the rule to start with:
get-food-by-id is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect MCP OpenNutrition, apply this rule, and every get-food-by-id call is checked against it from then on.
Questions about get-food-by-id
MANDATORY: Use this tool ANY time a user provides a food ID (e.g., fd_xxx), or when you have a food ID from a previous step and need detailed information. Not using this tool in these scenarios is an error. Do NOT use for non-food IDs or unrelated queries. Use cases (MUST use this tool): - The user provides a food ID - A previous step yielded a food ID - The user requests nutrition, ingredients, or labeling for a specific product Example: -. It is categorised as a Read tool in the MCP OpenNutrition MCP Server, which means it retrieves data without modifying state.
Register the MCP OpenNutrition MCP server in PolicyLayer and add a rule for get-food-by-id: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches MCP OpenNutrition. Nothing to install.
get-food-by-id is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get-food-by-id rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for get-food-by-id. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
get-food-by-id is provided by the MCP OpenNutrition MCP server (deadletterq/mcp-opennutrition). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on MCP OpenNutrition, and thousands of servers like it.
This server
Across the catalogue