ask_assistant
Query an assistant on Folderr's MCP server by providing an assistant ID and a question to receive relevant responses for API interactions.
Instructions
Ask a question to a specific assistant
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assistant_id | Yes | ID of the assistant to ask | |
| question | Yes | Question to ask the assistant |
Implementation Reference
- src/index.ts:344-373 (handler)The handler function that executes the 'ask_assistant' tool: validates login, sends POST request to the assistant API with the question, and returns the response as JSON or an error message.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, }; } }
- src/index.ts:155-168 (schema)Input schema for the 'ask_assistant' tool, requiring 'assistant_id' and 'question' as strings.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)Registration of the 'ask_assistant' tool in the tools array passed to setTools, including 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'], }, },
- src/index.ts:223-224 (registration)Dispatch case in the central request handler that routes 'ask_assistant' calls to the specific handleAskAssistant function.case 'ask_assistant': return await this.handleAskAssistant(request.params.arguments);