Skip to main content
Glama
domdomegg

openfoodfacts-mcp

Call API

call_api

Make direct API calls to Open Food Facts to query or update product data. Supports all HTTP methods and automatic authentication for writes. Use get_api_docs for endpoint list.

Instructions

Make a direct call to any Open Food Facts API endpoint. Use get_api_docs to see available endpoints. Auth credentials are included automatically for write operations if configured.

Two body modes for writes:

  • params: form-encoded (for /cgi/.pl and /api/v2/ legacy endpoints)

  • json_body: raw JSON (for /api/v3/* endpoints — required for structured fields like packagings)

Example v3 packagings write: method: PATCH endpoint: /api/v3/product/0123456789012 json_body: {"fields":"packagings","product":{"packagings":[{"number_of_units":1,"shape":{"id":"en:bag"},"material":{"id":"en:plastic"},"recycling":{"id":"en:recycle"}}]}}

WARNING: Do NOT use old-style prepared nutrition params like nutriment_fat_prepared — they have a known server bug that stores data incorrectly. Use new-style params instead: nutrition_input_sets_prepared_100g_nutrients_fat_value_string=0.5

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoHTTP method (default: GET)GET
endpointYesAPI endpoint path (e.g. "/api/v2/product/3017620422003.json")
paramsNoQuery parameters (for GET) or form-encoded body fields (for POST/PUT/PATCH to v1/v2 endpoints like /cgi/product_jqm2.pl). Auth fields are added automatically.
json_bodyNoRaw JSON body for v3 endpoints (e.g. PATCH /api/v3/product/{code}). When set, params is ignored and Content-Type is application/json. Auth fields are injected at the top level. Use this for structured writes like packagings.
Behavior5/5

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

The description goes beyond annotations (which only indicate readOnlyHint=false) by detailing that auth credentials are included automatically for writes, explaining the two body modes with their respective endpoint types, and flagging a server bug. This provides rich behavioral context.

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?

The description is well-structured: it starts with the main purpose, then provides usage details, a code example, and a warning. It is informative without being overly verbose, though the example could be slightly shortened. Overall, it earns its place.

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 (generic API caller), the description covers essential aspects: endpoint usage, authentication, body modes, and a bug warning. No output schema exists, but for a general-purpose tool, the description is sufficiently complete for an agent to invoke it correctly.

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?

The input schema has 100% description coverage, but the description adds significant value by clarifying the conditions for using params vs json_body (e.g., params for /cgi/*.pl and json_body for /api/v3/*), and including a concrete example for v3 packagings writes. This enhances understanding beyond the schema.

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 'Make a direct call to any Open Food Facts API endpoint', specifying the verb (call) and resource (any API endpoint). It differentiates from sibling tools like get_product or search_products, which are more specialized, making the tool's general-purpose nature obvious.

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

Usage Guidelines4/5

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

The description advises to 'Use get_api_docs to see available endpoints' and explains two body modes for writes (params vs json_body). It also warns about a known server bug. While it doesn't explicitly state when to use alternative tools, the context is clear enough for an agent to decide.

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/domdomegg/openfoodfacts-mcp'

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