Skip to main content
Glama
folderr-tech

Folderr

Official
by folderr-tech

ask_assistant

Ask questions to a specific Folderr assistant using its ID to get targeted responses for your queries.

Instructions

Ask a question to a specific assistant

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assistant_idYesID of the assistant to ask
questionYesQuestion to ask the assistant

Implementation Reference

  • The main handler function for the 'ask_assistant' tool. Checks authentication, POSTs question to /api/agent/{assistant_id}/message, returns JSON response or error.
    private async handleAskAssistant(args: any) {
      if (!this.config.token) {
        throw new McpError(ErrorCode.InvalidRequest, 'Not logged in');
      }
    
      try {
        const response = await this.axiosInstance.post(
          `/api/agent/${args.assistant_id}/message`,
          { message: args.question }
        );
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Failed to ask assistant: ${error.response?.data?.message || error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema defining required 'assistant_id' (string) and 'question' (string) for the tool.
    inputSchema: {
      type: 'object',
      properties: {
        assistant_id: {
          type: 'string',
          description: 'ID of the assistant to ask',
        },
        question: {
          type: 'string',
          description: 'Question to ask the assistant',
        },
      },
      required: ['assistant_id', 'question'],
    },
  • src/index.ts:152-169 (registration)
    Tool registration object added to the MCP server's tools list, with name, description, and input schema.
    {
      name: 'ask_assistant',
      description: 'Ask a question to a specific assistant',
      inputSchema: {
        type: 'object',
        properties: {
          assistant_id: {
            type: 'string',
            description: 'ID of the assistant to ask',
          },
          question: {
            type: 'string',
            description: 'Question to ask the assistant',
          },
        },
        required: ['assistant_id', 'question'],
      },
    },
  • Dispatch case in the CallToolRequest handler that routes 'ask_assistant' to its handler function.
    case 'ask_assistant':
      return await this.handleAskAssistant(request.params.arguments);

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/folderr-tech/folderr-mcp-server'

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