Skip to main content
Glama

Encode a food description as a FoodEx2 code

encode
Read-only

Turn one English food description (a food, drink, dish or meal) into a FoodEx2 code from the EFSA MTX catalogue: base term, facet descriptors for stated attributes the term does not imply, and labelled free text for what the code cannot express. Returns a short explanation of how the code was reached. Takes a few seconds for a direct name match, typically 15–25 seconds when the catalogue must be walked.

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": {
      "description": "<description>"
    },
    "name": "encode"
  }
}

Input Schema

NameRequiredDescriptionDefault
countryNoThe country the food description comes from, as a two-letter ISO 3166-1 alpha-2 country code, e.g. US, GB (United Kingdom) or IT, or EU for the European Union. Food names can mean different foods in different countries. When omitted, the encode assumes the European Union.
descriptionYesThe food description, e.g. 'fried rice with chicken' (at most 300 characters)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / country / description
      Previous value: -"Optional but recommended: the country the food description comes from, as a two-letter ISO 3166-1 alpha-2 country code, e.g. US, GB (United Kingdom) or IT, or EU for the European Union. Food names can mean different foods in different countries, so pass it whenever it is known."New value: +"The country the food description comes from, as a two-letter ISO 3166-1 alpha-2 country code, e.g. US, GB (United Kingdom) or IT, or EU for the European Union. Food names can mean different foods in different countries. When omitted, the encode assumes the European Union."
  2. Changed1 schema field changed
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Optional but recommended: the country the food description comes from, as a two-letter ISO 3166-1 alpha-2 country code, e.g. US, GB (United Kingdom) or IT, or EU for the European Union. Food names can mean different foods in different countries, so pass it whenever it is known.",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description is consistent with a closed, read-only lookup against a fixed catalogue. Beyond that it adds genuinely useful behavior: the returned structure (base term, facets only for attributes the term does not imply, free text for the unexpressible), a short rationale, and a realistic latency profile of seconds to 15–25 seconds.

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?

Three sentences, front-loaded with the transformation, then the output shape, then the cost profile. No filler, and the latency detail is actionable rather than padding because it sets timeout expectations for the slow path.

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 no output schema, the description carries the return-value burden and does so adequately, and the read-only, closed-world annotations cover the safety profile. The remaining gap is edge-case behavior, such as what happens when no plausible base term matches or how an over-length description is handled, though the 300-character limit is covered by the schema.

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 both the description text and the country code with its ISO format and default of EU are already documented in the schema; the baseline of 3 applies. The description adds nothing about the country parameter's purpose (disambiguating regionally different food names) even though that is the key non-obvious input decision for an agent.

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 concrete verb and resource: turn a single English food description into a FoodEx2 code from the EFSA MTX catalogue. It also enumerates the composition of the output (base term, facet descriptors, labelled free text), so an agent knows exactly what kind of artifact it gets back and cannot confuse this with the account_status sibling.

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?

The scope is implied well enough to route work here ('one English food description', limited to food/drink/dish/meal), and the latency note helps an agent decide whether to call it synchronously. However, there is no explicit when-to-use versus when-not statement, no guidance on the common failure case of an unmatched description, and no stated alternative pathway.

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.