get_boards
Retrieve a list of all Canny boards accessible with your current API key to manage customer feedback platforms.
Instructions
List all Canny boards accessible with the current API key
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/boards.ts:12-50 (handler)Definition of the get_boards tool including its handler function that fetches and formats the list of Canny boards.
export const getBoardsTool = { name: 'get_boards', description: 'List all Canny boards accessible with the current API key', inputSchema: { type: 'object', properties: {}, additionalProperties: false, }, handler: async (args: unknown, client: CannyClient) => { validateToolInput<GetBoardsInput>(args, GetBoardsSchema); const response = await client.getBoards(); if (response.error) { throw new Error(`Failed to fetch boards: ${response.error}`); } if (!response.data || response.data.length === 0) { return 'No boards found or you do not have access to any boards.'; } const boards = response.data.map(board => ({ id: board.id, name: board.name, url: board.url, postCount: board.postCount, isPrivate: board.isPrivate, })); return `Found ${boards.length} board(s):\n\n${boards .map(board => `**${board.name}** (ID: ${board.id})\n` + ` - URL: ${board.url}\n` + ` - Posts: ${board.postCount}\n` + ` - Private: ${board.isPrivate ? 'Yes' : 'No'}\n` ) .join('\n')}`; }, }; - src/tools/boards.ts:5-5 (schema)Zod schema for validating get_boards tool input (no parameters required).
const GetBoardsSchema = z.object({}); - src/tools/index.ts:29-45 (registration)Registration of the getBoardsTool in the main tools array for MCP.
export const tools: Tool[] = [ // Board management getBoardsTool, // Post management getPostsTool, getPostTool, searchPostsTool, createPostTool, updatePostTool, // Extended functionality - temporarily disabled for debugging // getCategoresTool, // getCommentsTool, // getUsersTool, // getTagsTool, ]; - src/client/canny.ts:92-114 (helper)The CannyClient.getBoards() method called by the tool handler to fetch boards from the API.
/** * Get all boards accessible to the API key */ async getBoards(): Promise<CannyApiResponse<CannyBoard[]>> { const response = await this.makeRequest<{ boards: CannyBoard[] }>({ method: 'GET', url: '/boards/list', }); // Handle the nested response structure if (response.data && response.data.boards) { return { data: response.data.boards, status: response.status, }; } return { data: [], status: response.status, error: response.error, }; }