Skip to main content
Glama

ask_support

Get answers to support questions with related FAQs and suggested actions for FitSlot services and bioimpedance analysis.

Instructions

Ask a support question and get helpful responses with related FAQs and suggested actions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • The execute function implementing the core logic of the 'ask_support' tool. It processes the user query, fetches response from ChatbotService, and returns structured JSON output or error.
    execute: async (args: { query: string }) => {
      try {
        logger.info('Processing support query', args);
    
        validateNotEmpty(args.query, 'Query');
    
        const response = await chatbotService.getChatbotResponse(args.query);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  success: true,
                  response: {
                    message: response.message,
                    relatedFAQs: response.relatedFAQs?.map(faq => ({
                      question: faq.question,
                      answer: faq.answer,
                      category: faq.category
                    })),
                    suggestedActions: response.suggestedActions
                  }
                },
                null,
                2
              )
            }
          ]
        };
      } catch (error) {
        logger.error('Failed to process support query', error);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  success: false,
                  error: error instanceof Error ? error.message : 'Unknown error'
                },
                null,
                2
              )
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema definition for the 'ask_support' tool input parameters, specifying the required 'query' string.
    description: 'Ask a support question and get helpful responses with related FAQs and suggested actions',
    parameters: z.object({
      query: z.string().describe('The user\'s question or support query')
    }),
  • src/index.ts:60-68 (registration)
    Registration of the chatbot tools (including 'ask_support') by creating the tools object and merging into the central 'allTools' used by MCP server's ListTools and CallTool handlers.
    const ticketTools = createTicketTools(apiService);
    const chatbotTools = createChatbotTools(chatbotService);
    const pdfTools = createPDFTools(pdfService);
    
    const allTools = {
      ...ticketTools,
      ...chatbotTools,
      ...pdfTools
    };

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