livsmedel-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LIVSMEDEL_DEBUG | No | 1 logs each request (method, path, status, timing) to stderr. Keys are never logged. | |
| LIVSMEDEL_API_KEY | No | Sent on every request if set. The public API does not need one. | |
| LIVSMEDEL_BASE_URL | No | Point at a proxy, a mirror or a mock server. | https://dataportal.livsmedelsverket.se/livsmedel/api/v1 |
| LIVSMEDEL_LANGUAGE | No | Default language for names: en or sv. | en |
| LIVSMEDEL_TIMEOUT_MS | No | Per-request timeout. | 15000 |
| LIVSMEDEL_MAX_RETRIES | No | Retries for 408, 425, 429, 5xx (except 501), timeouts and network errors. | 3 |
| LIVSMEDEL_API_KEY_HEADER | No | Header for the key. If set to Authorization, the key is sent as Bearer <key>. | x-api-key |
| LIVSMEDEL_CACHE_TTL_SECONDS | No | How long responses are cached in memory. 0 turns caching off. | 21600 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_foodsA | Search the Swedish Food Agency's food composition database (about 2,600 foods and dishes) by name. Returns food numbers to use with the other tools. All words in the query must appear in the name. Results are ranked, paginated, and include next_cursor when more matches exist. |
| get_foodA | Get one food by number: type, scientific name, cooking method, a short nutrition summary per 100 g (energy, fat, saturated fat, carbohydrates, sugar, fibre, protein, salt) and optionally its classifications, recipe ingredients and raw materials. |
| get_nutrientsA | Get nutrient values per 100 g for one food. Returns all ~60 nutrients (vitamins, minerals, fatty acids, sugars, energy) unless you pass a nutrients filter. Unknown filter terms are listed in 'unmatched'. |
| compare_foodsA | Compare 2-6 foods side by side on the same nutrients (per 100 g). Defaults to the nutrition declaration set: energy, fat, saturated fat, carbohydrates, sugar, fibre, protein, salt. |
| calculate_recipe_nutritionA | Calculate the nutrition of a recipe or meal from food numbers and gram amounts. Returns totals, per serving and per 100 g. Uses the stored values as-is: if you pass raw ingredients, cooking losses are not modelled. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| nutrition_label | Turn a recipe written in plain text into an EU-style nutrition declaration per 100 g and per serving. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool targets a distinct operation: searching, retrieving a basic record, retrieving detailed nutrients, comparing foods, and calculating recipe nutrition. The only mild overlap is between get_food's summary and get_nutrients' detailed values, but their scopes are clear.
All tools follow a consistent verb_noun snake_case pattern: search_foods, get_food, get_nutrients, compare_foods, calculate_recipe_nutrition. The singular/plural objects are semantically appropriate.
Five tools is well-scoped for a food composition database MCP. The set covers discovery, detailed lookup, comparison, and recipe calculation without unnecessary extras.
For a read-only database, the surface is complete: search finds foods, get_food gives the record, get_nutrients gives full nutrient detail, compare_foods supports side-by-side analysis, and calculate_recipe_nutrition handles meal-level use cases. The documented limitation about cooking losses is reasonable rather than a gap.