Skip to main content
Glama
c0dr

Canteen MCP

by c0dr

get_lunch_menu

Read-only

Retrieve the daily lunch menu from the canteen for a specified date using a structured API, enabling easy integration and timely access to meal information.

Instructions

Get the lunch menu from the canteen for a specific date

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesThe date to get the menu for (YYYY-MM-DD)

Implementation Reference

  • The execute handler for the get_lunch_menu tool. It fetches the lunch menu from an external API using axios for the specified date and returns the JSON response.
    execute: async (args) => {
      try {
        const response = await axios.get(process.env.API_URL!, {
          params: { date: args.date }
        });
        return JSON.stringify(response.data, null, 2);
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Failed to fetch menu: ${error.message}`);
        }
        throw error;
      }
  • Zod schema defining the input parameters for the get_lunch_menu tool, requiring a 'date' string that must be a valid date.
    parameters: z.object({
      date: z.string().date(),
    }),
  • src/server.ts:35-59 (registration)
    Registration of the get_lunch_menu tool via server.addTool, including annotations, description, name, parameters schema, and inline handler function.
    server.addTool({
      annotations: {
        openWorldHint: true, // This tool interacts with external API
        readOnlyHint: true, // This tool doesn't modify anything
        title: "Lunch Menu",
      },
      description: "Get the lunch menu from the canteen for a specific date",
      execute: async (args) => {
        try {
          const response = await axios.get(process.env.API_URL!, {
            params: { date: args.date }
          });
          return JSON.stringify(response.data, null, 2);
        } catch (error) {
          if (axios.isAxiosError(error)) {
            throw new Error(`Failed to fetch menu: ${error.message}`);
          }
          throw error;
        }
      },
      name: "get_lunch_menu",
      parameters: z.object({
        date: z.string().date(),
      }),
    });
Behavior3/5

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

Annotations already provide readOnlyHint=true and openWorldHint=true, indicating this is a safe read operation with open-world assumptions. The description adds context about retrieving a menu for a date but does not disclose additional behavioral traits like error handling, data freshness, or format details. No contradiction with annotations is present.

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, clear sentence that efficiently conveys the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand quickly.

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?

Given the tool's low complexity (one parameter, read-only, no output schema), the description is reasonably complete. It covers the main action and parameter intent, though it could benefit from mentioning the return format or potential limitations. With annotations handling safety and world assumptions, the description is adequate but not exhaustive.

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%, with the parameter 'date' fully documented in the schema (including description, pattern, and type). The description mentions 'for a specific date' but adds no extra meaning beyond what the schema provides, so it meets the baseline of 3 for high schema coverage.

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 tool's purpose with a specific verb ('Get') and resource ('lunch menu from the canteen'), including the scope ('for a specific date'). It distinguishes what the tool does effectively, though there are no sibling tools to differentiate from, which prevents a perfect score of 5.

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

Usage Guidelines3/5

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

The description implies usage by specifying 'for a specific date', suggesting when to use it (when you need a menu for a particular date). However, it lacks explicit guidance on when not to use it or alternatives, and there are no sibling tools mentioned, so no comparison is provided.

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

Related 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/c0dr/canteen-mcp'

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