Skip to main content
Glama

Get By Nutrition

get_by_nutrition
Read-onlyIdempotent

Find fruits matching a nutritional range. Specify nutrient type (calories, sugar, fat, carbs, protein) and min/max values to filter results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxYesMaximum value for the nutrient (inclusive).
minYesMinimum value for the nutrient (inclusive).
nutrientYesThe nutrient to filter by. One of: calories, sugar, fat, carbohydrates, protein.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxYesMaximum nutrient value for filtering
minYesMinimum nutrient value for filtering
countYesNumber of fruits matching the criteria
fruitsYes
nutrientYesThe nutrient type used for filtering

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "count": {
      +      "description": "Number of fruits matching the criteria",
      +      "type": "number"
      +    },
      +    "fruits": {
      +      "items": {
      +        "properties": {
      +          "family": {
      +            "description": "Plant family classification",
      +            "type": "string"
      +          },
      +          "genus": {
      +            "description": "Genus classification",
      +            "type": "string"
      +          },
      +          "id": {
      +            "description": "Unique identifier for the fruit",
      +            "type": "number"
      +          },
      +          "name": {
      +            "description": "Name of the fruit",
      +            "type": "string"
      +          },
      +          "nutritions": {
      +            "properties": {
      +              "calories": {
      +                "description": "Calories per 100g",
      +                "type": "number"
      +              },
      +              "carbohydrates": {
      +                "description": "Carbohydrates per 100g in grams",
      +                "type": "number"
      +              },
      +              "fat": {
      +                "description": "Fat content per 100g in grams",
      +                "type": "number"
      +              },
      +              "protein": {
      +                "description": "Protein content per 100g in grams",
      +                "type": "number"
      +              },
      +              "sugar": {
      +                "description": "Sugar content per 100g in grams",
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "calories",
      +              "fat",
      +              "sugar",
      +              "carbohydrates",
      +              "protein"
      +            ],
      +            "type": "object"
      +          },
      +          "order": {
      +            "description": "Order classification",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "name",
      +          "family",
      +          "genus",
      +          "order",
      +          "nutritions"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "max": {
      +      "description": "Maximum nutrient value for filtering",
      +      "type": "number"
      +    },
      +    "min": {
      +      "description": "Minimum nutrient value for filtering",
      +      "type": "number"
      +    },
      +    "nutrient": {
      +      "description": "The nutrient type used for filtering",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "nutrient",
      +    "min",
      +    "max",
      +    "count",
      +    "fruits"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "max": 60,
      +    "min": 40,
      +    "nutrient": "calories"
      +  },
      +  {
      +    "max": 15,
      +    "min": 10,
      +    "nutrient": "sugar"
      +  }
      +]
  3. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true, so the safety profile is established. The description adds the scoping behavior (nutritional range filtering) but no additional details like return format or pagination. This is adequate but not rich.

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?

The description is two concise sentences, front-loaded with the core action and resource, followed by the filtering specifics. There is no verbose or redundant wording.

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?

For a simple read-only tool with three required parameters and an output schema, the description covers the operation and input guidance adequately. The minor nutrient naming discrepancy is a small gap, but the description is otherwise complete.

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 each parameter is already well-documented. The description reiterates the nutrient types and min/max values but adds little new meaning. There is a minor inconsistency: description says 'carbs' while schema says 'carbohydrates'.

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 'Find fruits matching a nutritional range' with a specific verb and resource, distinguishing itself from siblings like list_fruits and get_fruit by focusing on nutritional filtering. It precisely conveys the tool's purpose and scope.

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 provides clear context: use this tool when you need fruits filtered by nutrient type and min/max values. It does not explicitly mention alternatives or exclusions, but the intended use case is well implied through the filter specification.

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.