Skip to main content
Glama
Kong

For Five Coffee MCP Server

by Kong

get_items_by_category

Retrieve all menu items from a specified category to quickly access and organize coffee shop offerings by type.

Instructions

Get all menu items from a specific category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesThe category name to filter by

Implementation Reference

  • The main handler function that fetches the menu data, filters items by the given category (case-insensitive), and returns a structured JSON response with the category name, item count, and matching items.
    async getItemsByCategory(category) {
      const menuData = await this.fetchMenuData();
      const categoryItems = menuData.items.filter(
        item => item.category.toLowerCase() === category.toLowerCase()
      );
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                category,
                itemCount: categoryItems.length,
                items: categoryItems,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Defines the input schema for the tool, specifying that a 'category' string parameter is required.
    inputSchema: {
      type: 'object',
      properties: {
        category: {
          type: 'string',
          description: 'The category name to filter by',
        },
      },
      required: ['category'],
    },
  • server.js:73-86 (registration)
    Registers the tool in the MCP ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: 'get_items_by_category',
      description: 'Get all menu items from a specific category',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'The category name to filter by',
          },
        },
        required: ['category'],
      },
    },
  • server.js:109-110 (registration)
    Dispatches calls to the getItemsByCategory handler in the MCP CallToolRequestSchema switch statement.
    case 'get_items_by_category':
      return await this.getItemsByCategory(args.category);
  • server.js:183-192 (registration)
    Registers an HTTP REST API endpoint (/api/menu/category/:category) that calls the getItemsByCategory handler and returns JSON.
    this.app.get('/api/menu/category/:category', async (req, res) => {
      try {
        const { category } = req.params;
        const result = await this.getItemsByCategory(category);
        const categoryData = JSON.parse(result.content[0].text);
        res.json(categoryData);
      } catch (error) {
        res.status(500).json({ error: error.message });
      }
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool retrieves items but doesn't mention whether it's paginated, returns all items at once, requires authentication, has rate limits, or what happens if the category doesn't exist. This leaves significant behavioral gaps for a read operation.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized for a simple tool and front-loads the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with one parameter and no output schema, the description covers the basic purpose adequately. However, without annotations or output details, it lacks information about return format (e.g., list structure, item fields) and error handling, making it minimally viable but incomplete.

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?

The schema description coverage is 100% (the single parameter 'category' is fully documented in the schema), so the baseline is 3. The description adds no additional parameter information beyond what's already in the schema, such as category format examples or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('menu items') with a specific scope ('from a specific category'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'search_menu_items' or 'get_full_menu', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_menu_items' or 'get_full_menu'. It mentions filtering by category but doesn't explain when category-based filtering is preferred over other methods, leaving the agent with no usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Kong/for-five-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server