usda-mcp-server
Search foods, compare nutrients, and look up the full USDA FoodData Central database.
사용해야 할까요
품질 및 안전성
도구 정의와 프로토콜 준수에 대한 자동 분석을 기반으로 합니다.
컨텍스트 비용
이는 서버의 도구가 모델의 컨텍스트에 로드될 때마다 소비되는 대략적인 토큰 수입니다. 수치가 높을수록 다른 작업에 사용할 수 있는 주의가 줄어듭니다.
설치
원클릭 설치
`claude_desktop_config.json` 파일에 다음을 추가하세요:
{
"mcpServers": {
"usda-mcp-server": {
"command": "bun",
"args": [
"@cyanheads/usda-mcp-server"
]
}
}
}실행 가능한 패키지
0.1.11streamable-http원격 엔드포인트
https://usda.caseyjhand.com/mcpstreamable-http할 수 있는 일
도구 목록
도구 (5)
🟢usda_list_nutrients(category)
Look up the FDC nutrient reference table — all tracked nutrients with their numeric IDs, names, SR reference numbers, units, and categories. Use to resolve a nutrient name (e.g. "vitamin C") to its FDC ID (1162) before passing it to the nutrients[] filter on other tools. Filter by category (macronutrients, vitamins, minerals, lipids, amino_acids, or other) to narrow results. The data is static — call once and reuse the IDs.
입력 스키마
{
"type": "object",
"properties": {
"category": {
"description": "Filter to a nutrient category. Omit to return all ~150 tracked nutrients. Options: macronutrients, vitamins, minerals, lipids, amino_acids, other.",
"type": "string",
"enum": [
"macronutrients",
"vitamins",
"minerals",
"lipids",
"amino_acids",
"other"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"nutrients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "FDC nutrient ID — pass this to nutrients[] params on other tools."
},
"name": {
"type": "string",
"description": "Human-readable nutrient name (e.g. \"Protein\", \"Iron, Fe\")."
},
"number": {
"type": "string",
"description": "SR reference number (legacy identifier, e.g. \"203\")."
},
"unit": {
"type": "string",
"description": "Measurement unit (e.g. \"G\", \"MG\", \"UG\", \"KCAL\")."
},
"category": {
"type": "string",
"description": "Nutrient category grouping."
}
},
"required": [
"id",
"name",
"number",
"unit",
"category"
],
"additionalProperties": false,
"description": "A nutrient reference entry with ID, name, unit, and category."
},
"description": "Nutrient reference entries matching the requested category, or all if category is omitted."
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Machine-readable failure mode."
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"nutrients"
]
},
{
"required": [
"error"
]
}
]
}🟢usda_search_foods(query, dataType, brandOwner, foodCategory, pageSize, ...)
Search USDA FoodData Central foods by keyword. Returns matching foods with FDC IDs and a preview of key nutrients (energy, protein, fat, carbs — not guaranteed complete). Use the returned fdcId with usda_get_food for the full nutrient profile, or usda_compare_foods for side-by-side comparisons. When dataType is omitted, defaults to SR Legacy (common whole foods with complete profiles) — or to Branded when brandOwner is set, since only Branded records carry one. Set dataType to ["Branded"] for packaged products, or include a UPC/GTIN code as the query. Pass brandOwner (e.g. "General Mills") to narrow branded results.
입력 스키마
{
"type": "object",
"properties": {
"query": {
"type": "string",
"minLength": 1,
"description": "Search terms — food name, ingredient, or UPC/GTIN code for branded products. Examples: \"chicken breast raw\", \"banana\", \"012345678901\"."
},
"dataType": {
"description": "FDC data sources to search. Omitting this defaults to [\"SR Legacy\"] (common whole foods, complete nutrient profiles), or to [\"Branded\"] when brandOwner is set. Include \"Branded\" for packaged products. Multiple values allowed.",
"type": "array",
"items": {
"type": "string",
"enum": [
"SR Legacy",
"Foundation",
"Survey (FNDDS)",
"Branded"
]
}
},
"brandOwner": {
"description": "Filter branded results by brand owner name (e.g. \"General Mills\", \"Kraft\"). Only Branded records carry one, so setting this defaults dataType to [\"Branded\"] unless dataType is given explicitly.",
"type": "string"
},
"foodCategory": {
"description": "Filter by USDA food category (e.g. \"Poultry Products\", \"Vegetables and Vegetable Products\"). Case-sensitive.",
"type": "string"
},
"pageSize": {
"default": 10,
"description": "Number of results per page. Default 10, maximum 50.",
"type": "integer",
"minimum": 1,
"maximum": 50
},
"pageNumber": {
"default": 1,
"description": "Page number (1-based). Use with totalPages to paginate.",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"query"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"totalHits": {
"type": "number",
"description": "Total number of foods matching the query across all pages."
},
"currentPage": {
"type": "number",
"description": "Current page number (1-based)."
},
"totalPages": {
"type": "number",
"description": "Total number of pages available."
},
"foods": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fdcId": {
"type": "number",
"description": "FDC ID — pass to usda_get_food, usda_get_foods, or usda_compare_foods."
},
"description": {
"type": "string",
"description": "USDA food description (e.g. \"Chicken, broilers or fryers, breast, meat only, raw\")."
},
"dataType": {
"type": "string",
"description": "FDC data source: SR Legacy, Foundation, Survey (FNDDS), or Branded."
},
"foodCategory": {
"description": "USDA food category (e.g. \"Poultry Products\"). Absent for some branded items.",
"type": "string"
},
"brandOwner": {
"description": "Brand owner name. Present for Branded items only.",
"type": "string"
},
"brandName": {
"description": "Brand name. Present for Branded items only.",
"type": "string"
},
"servingSize": {
"description": "Serving size in grams from the product label. Branded only.",
"type": "number"
},
"servingSizeUnit": {
"description": "Unit for servingSize (usually \"g\"). Branded only.",
"type": "string"
},
"householdServingFullText": {
"description": "Serving description as it appears on the label (e.g. \"1 cup\", \"1 oz\"). Branded only.",
"type": "string"
},
"nutrients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "FDC nutrient ID."
},
"name": {
"type": "string",
"description": "Nutrient name."
},
"amount": {
"type": "number",
"description": "Amount per 100g."
},
"unit": {
"type": "string",
"description": "Unit (e.g. \"G\", \"MG\", \"KCAL\")."
}
},
"required": [
"id",
"name",
"amount",
"unit"
],
"additionalProperties": false,
"description": "A preview nutrient entry with ID, name, and amount per 100g."
},
"description": "Preview nutrients per 100g — typically energy, protein, fat, carbs for SR Legacy. Not a complete profile; use usda_get_food for the full set."
},
"publishedDate": {
"description": "Date the food entry was published in FDC.",
"type": "string"
}
},
"required": [
"fdcId",
"description",
"dataType",
"nutrients"
],
"additionalProperties": false,
"description": "A food item matching the search query."
},
"description": "Foods matching the search query."
},
"totalCount": {
"type": "number",
"description": "Total foods matching the query across all pages."
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Machine-readable failure mode. Declared by this tool: `query_empty`: The query is empty or contains only whitespace. `no_results`: No foods matched the query in the specified data sources. Other values are possible when a failure originates below the handler.",
"examples": [
"query_empty",
"no_results"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"totalHits",
"currentPage",
"totalPages",
"foods",
"totalCount"
]
},
{
"required": [
"error"
]
}
]
}🟢usda_get_food(fdcId, nutrients, quantity, unit)
Get the full nutrient profile for one food by FDC ID. Returns all available nutrients (or a filtered subset via the nutrients[] param) with optional per-portion scaling. Use usda_search_foods to discover FDC IDs. Provide quantity + unit to scale all nutrient values from per-100g to the specified portion (e.g. quantity=200, unit="g" → per-200g values). Use unit="serving" to scale to the food's first defined portion weight. Narrow nutrients[] to specific IDs to reduce response size for focused queries.
입력 스키마
{
"type": "object",
"properties": {
"fdcId": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991,
"description": "FDC ID of the food. Use usda_search_foods to discover IDs."
},
"nutrients": {
"description": "Filter to specific nutrient IDs (e.g. [1003, 1004, 1005, 1008] for protein, fat, carbs, energy). Use usda_list_nutrients to look up IDs. Omit to return all available nutrients.",
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"quantity": {
"description": "Amount of food to scale nutrient values to. Must be positive. When provided, unit is required. Omit for per-100g values (FDC database native basis).",
"type": "number",
"exclusiveMinimum": 0
},
"unit": {
"description": "Unit for quantity. \"serving\" uses the food's first defined portion weight. Required when quantity is provided.",
"type": "string",
"enum": [
"g",
"oz",
"lb",
"kg",
"serving"
]
}
},
"required": [
"fdcId"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"fdcId": {
"type": "number",
"description": "FDC ID of the food."
},
"description": {
"type": "string",
"description": "Full USDA food name (e.g. \"Chicken, broilers or fryers, breast, meat only, raw\")."
},
"dataType": {
"type": "string",
"description": "FDC data source: SR Legacy, Foundation, Survey (FNDDS), or Branded."
},
"foodCategory": {
"description": "USDA food category (e.g. \"Poultry Products\"). Absent for some branded items.",
"type": "string"
},
"publicationDate": {
"description": "Date this food entry was published in FDC.",
"type": "string"
},
"brandOwner": {
"description": "Brand owner. Branded items only.",
"type": "string"
},
"brandName": {
"description": "Brand name. Branded items only.",
"type": "string"
},
"ingredients": {
"description": "Ingredient list from label. Branded items only.",
"type": "string"
},
"servingInfo": {
"description": "First available portion definition, if present.",
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Portion description (e.g. \"1 cup\", \"4 oz\")."
},
"gramWeight": {
"type": "number",
"description": "Gram weight of this portion."
}
},
"required": [
"description",
"gramWeight"
],
"additionalProperties": false
},
"allPortions": {
"description": "All named portions for this food.",
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Portion description."
},
"gramWeight": {
"type": "number",
"description": "Gram weight of this portion."
}
},
"required": [
"description",
"gramWeight"
],
"additionalProperties": false,
"description": "A named portion for this food."
}
},
"scaledTo": {
"description": "Scaling basis when quantity+unit were provided. Absent when returning per-100g values.",
"type": "object",
"properties": {
"quantity": {
"type": "number",
"description": "Numeric quantity provided in the request."
},
"unit": {
"type": "string",
"description": "Unit provided in the request (g, oz, lb, kg, or serving)."
},
"gramWeight": {
"type": "number",
"description": "Gram weight resolved from quantity+unit — all nutrient values are per this many grams."
}
},
"required": [
"quantity",
"unit",
"gramWeight"
],
"additionalProperties": false
},
"nutrients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "FDC nutrient ID."
},
"name": {
"type": "string",
"description": "Nutrient name (e.g. \"Protein\", \"Energy\", \"Iron, Fe\")."
},
"number": {
"type": "string",
"description": "SR reference number (legacy identifier)."
},
"amount": {
"type": "number",
"description": "Nutrient amount — per 100g, or scaled to quantity+unit if provided."
},
"unit": {
"type": "string",
"description": "Measurement unit (e.g. \"G\", \"MG\", \"KCAL\")."
},
"percentDailyValue": {
"description": "Percent daily value from product label. Branded items only.",
"type": "number"
}
},
"required": [
"id",
"name",
"number",
"amount",
"unit"
],
"additionalProperties": false,
"description": "A single nutrient entry with ID, name, amount, and unit."
},
"description": "Nutrient values for this food, per 100g or scaled to the requested quantity."
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Machine-readable failure mode. Declared by this tool: `not_found`: The FDC ID does not exist in the database. `quantity_without_unit`: quantity is provided but unit is omitted. `no_portion_data`: unit=\"serving\" was requested but the food has no portion data. Other values are possible when a failure originates below the handler.",
"examples": [
"not_found",
"quantity_without_unit",
"no_portion_data"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"fdcId",
"description",
"dataType",
"nutrients"
]
},
{
"required": [
"error"
]
}
]
}🟢usda_get_foods(fdcIds, nutrients)
Fetch nutrient profiles for 2–20 foods in a single API call. More efficient than calling usda_get_food N times when you already have multiple FDC IDs. All values are per 100g (no portion scaling). Use the nutrients[] filter to limit response size — strongly recommended for batch calls. For side-by-side comparison with a formatted table, use usda_compare_foods instead. Failed IDs (not found or no data) are reported in the failed[] array rather than aborting the entire batch.
입력 스키마
{
"type": "object",
"properties": {
"fdcIds": {
"minItems": 2,
"maxItems": 20,
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"description": "FDC IDs to fetch — 2 to 20 IDs. Use usda_search_foods to discover IDs."
},
"nutrients": {
"description": "Filter to specific nutrient IDs (e.g. [1003, 1004, 1005, 1008]). Strongly recommended — full profiles can be large. Use usda_list_nutrients to look up IDs.",
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
}
},
"required": [
"fdcIds"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"foods": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fdcId": {
"type": "number",
"description": "FDC ID of this food."
},
"description": {
"type": "string",
"description": "Full USDA food name (e.g. \"Chicken, broilers or fryers, breast, meat only, raw\")."
},
"dataType": {
"type": "string",
"description": "FDC data source: SR Legacy, Foundation, Survey (FNDDS), or Branded."
},
"nutrients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "FDC nutrient ID."
},
"name": {
"type": "string",
"description": "Nutrient name."
},
"number": {
"type": "string",
"description": "SR reference number."
},
"amount": {
"type": "number",
"description": "Amount per 100g."
},
"unit": {
"type": "string",
"description": "Measurement unit (e.g. \"G\", \"MG\", \"KCAL\")."
}
},
"required": [
"id",
"name",
"number",
"amount",
"unit"
],
"additionalProperties": false,
"description": "A nutrient entry with ID, name, amount, and unit."
},
"description": "Nutrient values per 100g."
}
},
"required": [
"fdcId",
"description",
"dataType",
"nutrients"
],
"additionalProperties": false,
"description": "Nutrient profile for one food."
},
"description": "Successfully fetched foods."
},
"failed": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fdcId": {
"type": "number",
"description": "FDC ID that could not be fetched."
},
"error": {
"type": "string",
"description": "Why this ID failed — not found, no data returned, etc."
}
},
"required": [
"fdcId",
"error"
],
"additionalProperties": false,
"description": "A failed food fetch with the FDC ID and error reason."
},
"description": "IDs that returned no data. Check these with usda_search_foods to verify they exist."
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Machine-readable failure mode."
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"foods",
"failed"
]
},
{
"required": [
"error"
]
}
]
}🟢usda_compare_foods(fdcIds, nutrients, quantity, unit)
Compare nutrients side-by-side for 2–5 foods. Returns a structured table — one row per nutrient, one column per food — formatted as markdown. Best for "spinach vs kale iron" or "which has more protein?" questions. Omit nutrients[] to use the 12 most common defaults (energy, protein, fat, saturated fat, carbs, fiber, sugars, sodium, potassium, calcium, iron, vitamin C); provide nutrients[] with specific FDC IDs to compare different nutrients. All values are scaled to the same gram basis (default 100g). If one or more FDC IDs are not found, the comparison proceeds with the valid foods — only throws too_few_foods when fewer than 2 IDs return data.
입력 스키마
{
"type": "object",
"properties": {
"fdcIds": {
"minItems": 2,
"maxItems": 5,
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"description": "FDC IDs to compare — 2 to 5 foods. Use usda_search_foods to discover IDs."
},
"nutrients": {
"description": "Nutrient IDs to include in the comparison. Defaults to the 12 most common: energy (1008), protein (1003), total fat (1004), saturated fat (1258), carbohydrate (1005), fiber (1079), total sugars (2000), sodium (1093), potassium (1092), calcium (1087), iron (1089), vitamin C (1162). Use usda_list_nutrients to look up other IDs.",
"type": "array",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"quantity": {
"default": 100,
"description": "Gram basis for comparison. All values scaled to this amount. Must be positive. Default 100.",
"type": "number",
"exclusiveMinimum": 0
},
"unit": {
"default": "g",
"description": "Unit for quantity. Default \"g\". Does not support \"serving\" (use a fixed gram basis for consistent comparison).",
"type": "string",
"enum": [
"g",
"oz",
"lb",
"kg"
]
}
},
"required": [
"fdcIds"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"basis": {
"type": "object",
"properties": {
"quantity": {
"type": "number",
"description": "Numeric quantity provided in the request."
},
"unit": {
"type": "string",
"description": "Unit provided in the request (g, oz, lb, or kg)."
},
"gramWeight": {
"type": "number",
"description": "Gram weight resolved from quantity+unit — all nutrient values are per this many grams."
}
},
"required": [
"quantity",
"unit",
"gramWeight"
],
"additionalProperties": false,
"description": "The common scaling basis applied to all nutrient values."
},
"foods": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fdcId": {
"type": "number",
"description": "FDC ID."
},
"description": {
"type": "string",
"description": "Full USDA food name (e.g. \"Spinach, raw\")."
},
"dataType": {
"type": "string",
"description": "FDC data source: SR Legacy, Foundation, Survey (FNDDS), or Branded."
}
},
"required": [
"fdcId",
"description",
"dataType"
],
"additionalProperties": false,
"description": "One of the compared foods."
},
"description": "The compared foods, in the same order as the values arrays below."
},
"nutrients": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number",
"description": "FDC nutrient ID."
},
"name": {
"type": "string",
"description": "Nutrient name (e.g. \"Protein\", \"Energy\")."
},
"unit": {
"type": "string",
"description": "Measurement unit (e.g. \"G\", \"MG\", \"KCAL\")."
},
"values": {
"type": "array",
"items": {
"type": [
"number",
"null"
]
},
"description": "One value per food in the same order as foods[]. null when data is unavailable for that food."
}
},
"required": [
"id",
"name",
"unit",
"values"
],
"additionalProperties": false,
"description": "One nutrient row with per-food values."
},
"description": "Nutrient rows — one entry per requested nutrient, with per-food values in the values[] array."
},
"missingData": {
"description": "Foods or food+nutrient pairs where data was unavailable. Absent when all data was present.",
"type": "array",
"items": {
"type": "object",
"properties": {
"fdcId": {
"type": "number",
"description": "FDC ID that had missing data."
},
"nutrientId": {
"description": "Nutrient ID that was missing, or null when the entire food was not found.",
"type": [
"number",
"null"
]
}
},
"required": [
"fdcId",
"nutrientId"
],
"additionalProperties": false,
"description": "A food or food+nutrient pair where data was unavailable."
}
},
"error": {
"description": "Present when the call failed. Absent on success.",
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Machine-readable failure mode. Declared by this tool: `too_few_foods`: Fewer than 2 of the provided FDC IDs returned data, making comparison impossible. Other values are possible when a failure originates below the handler.",
"examples": [
"too_few_foods"
]
},
"recovery": {
"description": "Actionable next step for the caller.",
"type": "object",
"properties": {
"hint": {
"type": "string"
}
},
"required": [
"hint"
],
"additionalProperties": {}
},
"retryable": {
"description": "Whether retrying may succeed.",
"type": "boolean"
}
},
"additionalProperties": {}
}
},
"required": [
"code",
"message"
],
"additionalProperties": {}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"basis",
"foods",
"nutrients"
]
},
{
"required": [
"error"
]
}
]
}커뮤니티
증거