set_api_token
Configure API authentication for the Folderr MCP server by providing a token to enable interaction with Folderr Assistants without using login credentials.
Instructions
Set an API token for authentication (alternative to login)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | API token generated from Folderr developers section |
Implementation Reference
- src/index.ts:281-307 (handler)The handler function that executes the set_api_token tool logic: updates the configuration with the provided token, sets the Authorization header on the axios instance, saves the config to file, and returns a success or error response.private async handleSetApiToken(args: any) { try { // Update config and axios instance with new token this.config.token = args.token; this.axiosInstance.defaults.headers.common['Authorization'] = `Bearer ${this.config.token}`; this.saveConfig(); return { content: [ { type: 'text', text: 'Successfully set API token', }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Failed to set API token: ${error.message}`, }, ], isError: true, }; } }
- src/index.ts:114-123 (schema)Input schema for the set_api_token tool, defining a required 'token' property of type string.inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'API token generated from Folderr developers section', }, }, required: ['token'], },
- src/index.ts:111-124 (registration)Registration of the set_api_token tool in the ListToolsRequestSchema handler, providing name, description, and input schema.{ name: 'set_api_token', description: 'Set an API token for authentication (alternative to login)', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'API token generated from Folderr developers section', }, }, required: ['token'], }, },
- src/index.ts:219-220 (registration)Switch case in the CallToolRequestSchema handler that dispatches calls to the set_api_token tool to the handleSetApiToken method.case 'set_api_token': return await this.handleSetApiToken(request.params.arguments);