Food Search reference
Search the food catalogue, custom foods and saved meals for the ids that log_food_entry needs.
The DailyGoal API is not available on the Free plan. It works with a paid plan or during a free trial. See plans.
All operations require Pro or a trial. GET and DELETE take query parameters; other methods take a JSON body. The input table also includes any MCP-only idempotency_key argument; REST sends it as a header. See retrying creates. Example ids are synthetic; find your own with the search and list operations.
Operations
search_foods: Search foods
search_foods
GET https://api.dailygoal.fit/v1/foods
MCP tool search_foods · Read-only · DailyGoal data only
Search the DailyGoal food catalogue, the user's custom foods and their saved meals, optionally filtered by kind. Returns ids and per-serving nutrition for log_food_entry. Always call this tool for food nutrition questions; use the returned nutrition and serving size rather than recalled estimates. For what the user ate, use list_food_entries.
Input
| Field | Type | Description |
|---|---|---|
| queryoptional | string | Food name, optionally with a brand. Required unless kind is custom_food or saved_meal, which then lists the user's own items. |
| kindoptional | "food" | "custom_food" | "saved_meal" | food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry. |
| limitoptional | integer | Most results to return. Default 20. |
Full input schema, including bounds and nested alternatives (MCP)
{
"type": "object",
"properties": {
"query": {
"type": "string",
"maxLength": 100,
"description": "Food name, optionally with a brand. Required unless kind is custom_food or saved_meal, which then lists the user's own items."
},
"kind": {
"type": "string",
"enum": [
"food",
"custom_food",
"saved_meal"
],
"description": "food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 50,
"description": "Most results to return. Default 20."
}
},
"additionalProperties": true
}Output
| Field | Type | Description |
|---|---|---|
| foods | object[] | |
| foods[].id | string | |
| foods[].kind | "food" | "custom_food" | "saved_meal" | food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry. |
| foods[].name | string | |
| foods[].brandNameoptional | string | |
| foods[].serving | object | |
| foods[].serving.size | number | |
| foods[].serving.unit | string | |
| foods[].serving.textoptional | string | |
| foods[].perServing | object | |
| foods[].perServing.calories | number | kcal |
| foods[].perServing.protein | number | grams |
| foods[].perServing.carbs | number | grams |
| foods[].perServing.fat | number | grams |
| foods[].perServing.alcohol | number | grams |
| foods[].per100g | object | Foods: nutrition per 100 g/ml. Saved meals: stored whole-recipe nutrition; use perServing for logging. |
| foods[].per100g.calories | number | kcal |
| foods[].per100g.protein | number | grams |
| foods[].per100g.carbs | number | grams |
| foods[].per100g.fat | number | grams |
| foods[].per100g.alcohol | number | grams |
Full output schema
{
"type": "object",
"properties": {
"foods": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"food",
"custom_food",
"saved_meal"
],
"description": "food: the DailyGoal catalogue. custom_food: a food the user created. saved_meal: a meal the user saved, logged as one entry."
},
"name": {
"type": "string"
},
"brandName": {
"type": "string"
},
"serving": {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"unit": {
"type": "string"
},
"text": {
"type": "string"
}
},
"required": [
"size",
"unit"
],
"additionalProperties": true
},
"perServing": {
"type": "object",
"properties": {
"calories": {
"type": "number",
"description": "kcal"
},
"protein": {
"type": "number",
"description": "grams"
},
"carbs": {
"type": "number",
"description": "grams"
},
"fat": {
"type": "number",
"description": "grams"
},
"alcohol": {
"type": "number",
"description": "grams"
}
},
"required": [
"calories",
"protein",
"carbs",
"fat",
"alcohol"
],
"additionalProperties": true
},
"per100g": {
"type": "object",
"properties": {
"calories": {
"type": "number",
"description": "kcal"
},
"protein": {
"type": "number",
"description": "grams"
},
"carbs": {
"type": "number",
"description": "grams"
},
"fat": {
"type": "number",
"description": "grams"
},
"alcohol": {
"type": "number",
"description": "grams"
}
},
"required": [
"calories",
"protein",
"carbs",
"fat",
"alcohol"
],
"additionalProperties": true,
"description": "Foods: nutrition per 100 g/ml. Saved meals: stored whole-recipe nutrition; use perServing for logging."
}
},
"required": [
"id",
"kind",
"name",
"serving",
"perServing",
"per100g"
],
"additionalProperties": true
}
}
},
"required": [
"foods"
],
"additionalProperties": true
}Example request
curl "https://api.dailygoal.fit/v1/foods?query=oats&limit=5" \
-H "Authorization: Bearer $DAILYGOAL_API_TOKEN"{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_foods",
"arguments": {
"query": "oats",
"limit": 5
}
}
}Example response
Synthetic data. REST returns this object as the body; MCP returns it as structuredContent.
{
"foods": [
{
"id": "j57c2m8k4q1x9v3d6n0r5t7w2b8y4h1a",
"kind": "food",
"name": "Rolled oats",
"serving": {
"size": 40,
"unit": "g",
"text": "40 g"
},
"perServing": {
"calories": 152.8,
"protein": 5.3,
"carbs": 27.1,
"fat": 2.6,
"alcohol": 0
},
"per100g": {
"calories": 382.1,
"protein": 13.2,
"carbs": 67.7,
"fat": 6.5,
"alcohol": 0
}
},
{
"id": "j579h2c5m8q1x4v7n0r3t6w9b2y5k8dc",
"kind": "saved_meal",
"name": "Overnight oats with yoghurt and blueberries",
"serving": {
"size": 100,
"unit": "g",
"text": "1/2 of recipe"
},
"perServing": {
"calories": 326.1,
"protein": 20.8,
"carbs": 47.4,
"fat": 5.9,
"alcohol": 0
},
"per100g": {
"calories": 652.3,
"protein": 41.7,
"carbs": 94.9,
"fat": 11.8,
"alcohol": 0
}
}
]
}Errors
unauthorized(401)origin_not_allowed(403)misdirected_request(421)subscription_required(403)rate_limited(429)validation_failed(400)internal_error(500)