Skip to main content
Glama

Search Beer Styles

search_styles

Search BJCP beer styles by name, category, or characteristics. Returns vital statistics, typical ingredients, and commercial examples.

Instructions

Search BJCP beer styles by name, category, or characteristics. Returns vital statistics, overall impression, typical ingredients, and commercial examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesStyle name, category, or characteristic to search for

Implementation Reference

  • The async handler function that runs when 'search_styles' is invoked. It takes a 'query' string, runs fuzzySearch on STYLES data across multiple fields (name, category, overallImpression, ingredients, tags), returns up to 5 results formatted with vital stats, or a 'no results' message.
    async ({ query }) => {
      const results = fuzzySearch(
        STYLES,
        query,
        ["name", "category", "overallImpression", "ingredients", "tags"],
      ).slice(0, 5);
    
      if (results.length === 0) {
        return {
          content: [
            {
              type: "text" as const,
              text: `No styles found matching '${query}'. Try broader terms like 'IPA', 'stout', 'lager', or 'Belgian'.`,
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: "text" as const,
            text: results.map(formatStyle).join("\n\n---\n\n"),
          },
        ],
      };
    },
  • Registers the 'search_styles' tool on the MCP server using server.registerTool(), with a title, description, and inputSchema defined via Zod.
    export function registerSearchStyles(server: McpServer): void {
      server.registerTool(
        "search_styles",
        {
          title: "Search Beer Styles",
          description:
            "Search BJCP beer styles by name, category, or characteristics. Returns vital statistics, overall impression, typical ingredients, and commercial examples.",
          inputSchema: {
            query: z
              .string()
              .describe(
                "Style name, category, or characteristic to search for",
              ),
          },
        },
        async ({ query }) => {
          const results = fuzzySearch(
            STYLES,
            query,
            ["name", "category", "overallImpression", "ingredients", "tags"],
          ).slice(0, 5);
    
          if (results.length === 0) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `No styles found matching '${query}'. Try broader terms like 'IPA', 'stout', 'lager', or 'Belgian'.`,
                },
              ],
            };
          }
    
          return {
            content: [
              {
                type: "text" as const,
                text: results.map(formatStyle).join("\n\n---\n\n"),
              },
            ],
          };
        },
      );
    }
  • Input schema for the tool: a single 'query' string parameter described as 'Style name, category, or characteristic to search for'.
    {
      title: "Search Beer Styles",
      description:
        "Search BJCP beer styles by name, category, or characteristics. Returns vital statistics, overall impression, typical ingredients, and commercial examples.",
      inputSchema: {
        query: z
          .string()
          .describe(
            "Style name, category, or characteristic to search for",
          ),
      },
  • Calls registerSearchStyles(server) to register the tool when the server starts up.
    registerSearchStyles(server);
  • Helper function that formats a BeerStyle object into a markdown string containing name, ID, category, vital stats (OG, FG, IBU, SRM, ABV), overall impression, ingredients, and examples.
    function formatStyle(style: BeerStyle): string {
      const { vitalStats: v } = style;
      return [
        `## ${style.name} (${style.id})`,
        `Category: ${style.category}`,
        `OG: ${v.ogMin}-${v.ogMax} | FG: ${v.fgMin}-${v.fgMax}`,
        `IBU: ${v.ibuMin}-${v.ibuMax} | SRM: ${v.srmMin}-${v.srmMax} | ABV: ${v.abvMin}-${v.abvMax}%`,
        "",
        style.overallImpression,
        "",
        `Ingredients: ${style.ingredients}`,
        `Examples: ${style.examples}`,
      ].join("\n");
    }
Behavior2/5

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

No annotations are provided, and the description does not disclose important behavioral traits such as whether the search is case-sensitive, supports partial matches, or has any rate limits. It only states what it returns, not how it behaves.

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 concise with two sentences, front-loading the purpose and then listing the returns. Every sentence adds value without unnecessary detail.

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 search tool with one parameter and no output schema, the description adequately covers the input and output. It lacks details on edge cases (e.g., no results), but is sufficient for typical usage.

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 provides a description for the query parameter, and the tool description reiterates that it can be a name, category, or characteristic. Since schema coverage is 100%, the description adds minimal extra value beyond confirming the search criteria.

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 the action ('Search BJCP beer styles') and the criteria (name, category, characteristics), and lists the returned information. It is distinct from sibling tools which focus on off-flavors, water profiles, pairings, ingredients, and recipes.

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 for looking up beer styles, but does not explicitly state when to use this tool versus alternatives like search_ingredients or pairing_guide. No exclusions or context cues are 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

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/gregario/brewers-almanack'

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