Skip to main content
Glama

get_faqs_by_category

Retrieve frequently asked questions for a specific support category to quickly find relevant answers and solutions for user inquiries.

Instructions

Get all FAQs for a specific category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes

Implementation Reference

  • The execute handler function for the 'get_faqs_by_category' tool. It validates the category input, fetches FAQs using the chatbot service, formats the response as JSON, and handles errors.
      execute: async (args: { category: string }) => {
        try {
          logger.info('Getting FAQs by category', args);
    
          validateNotEmpty(args.category, 'Category');
    
          const faqs = chatbotService.getFAQsByCategory(args.category);
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(
                  {
                    success: true,
                    category: args.category,
                    count: faqs.length,
                    faqs: faqs.map(faq => ({
                      question: faq.question,
                      answer: faq.answer
                    }))
                  },
                  null,
                  2
                )
              }
            ]
          };
        } catch (error) {
          logger.error('Failed to get FAQs by category', error);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(
                  {
                    success: false,
                    error: error instanceof Error ? error.message : 'Unknown error'
                  },
                  null,
                  2
                )
              }
            ],
            isError: true
          };
        }
      }
    },
  • Zod input schema defining the required 'category' parameter as a string.
    parameters: z.object({
      category: z.string().describe('Category name to filter FAQs')
    }),
  • src/index.ts:60-68 (registration)
    Registration of the chatbot tools (including get_faqs_by_category) by creating the tools object via createChatbotTools and merging it into the allTools object used by MCP request handlers.
    const ticketTools = createTicketTools(apiService);
    const chatbotTools = createChatbotTools(chatbotService);
    const pdfTools = createPDFTools(pdfService);
    
    const allTools = {
      ...ticketTools,
      ...chatbotTools,
      ...pdfTools
    };
  • Helper method in ChatbotService that filters the hardcoded list of SupportFAQs by the given category (case-insensitive). Called by the tool handler.
    getFAQsByCategory(category: string): SupportFAQ[] {
      return this.faqs.filter(faq => 
        faq.category.toLowerCase() === category.toLowerCase()
      );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but reveals minimal behavioral traits. It states it 'gets' FAQs (likely a read operation) but doesn't disclose pagination behavior, rate limits, authentication requirements, error conditions, or what happens with invalid categories. The description doesn't contradict any annotations since none exist.

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 states the core purpose without unnecessary words. It's front-loaded with the essential information and contains zero redundant or decorative language.

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

Completeness2/5

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

For a read operation with no annotations, no output schema, and minimal parameter documentation, the description is insufficient. It doesn't explain what constitutes a 'category', how results are returned (list format, limits), or error handling. Given the server context with multiple FAQ-related tools, more guidance on tool selection would be valuable.

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 0% (parameter 'category' has no description in schema), but the tool description adds meaningful context by specifying 'category name to filter FAQs'. This clarifies the parameter's purpose beyond just its name, though it doesn't provide format examples, valid values, or constraints. With 1 parameter and partial compensation for the schema gap, baseline 3 is appropriate.

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 'FAQs' with the qualifier 'for a specific category', making the purpose unambiguous. It distinguishes from sibling 'get_all_faqs' by specifying category filtering, though it doesn't explicitly mention sibling 'search_faqs' which might offer alternative filtering approaches.

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 when needing FAQs filtered by category, but provides no explicit guidance on when to use this versus siblings like 'search_faqs' (which might offer more flexible filtering) or 'get_all_faqs' (which retrieves all FAQs without filtering). No prerequisites, exclusions, or alternatives are mentioned.

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/osmarsant/fitslot-mcp'

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