Skip to main content
Glama
get.ts1.55 kB
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { registerStructuredTool } from '../../patch'; import { z } from 'zod'; import { Brands } from 'knbn-core/utils/ts'; import { loadBoard } from 'knbn-core/utils/board-files'; import path from 'path'; import { pcwd } from 'knbn-core/utils/files'; import { zknbn } from '../../zod/output'; export const registerGetBoardTool = (server: McpServer) => registerStructuredTool(server, 'get_board', { title: 'Get KnBn Board', description: 'Get the full contents of a KnBn board file', inputSchema: { filename: z.string().optional().describe('Board filename (defaults to .knbn)'), }, outputSchema: { board: zknbn.board, }, annotations: { readOnlyHint: true, }, }, async (args) => { try { const filename = args.filename || '.knbn'; const filepath = Brands.Filepath(path.join(pcwd(), filename)); const board = loadBoard(filepath); return { structuredContent: { board: { name: board.name, description: board.description, columns: board.columns, tasks: board.tasks, labels: board.labels, sprints: board.sprints, metadata: board.metadata, dates: board.dates, }, }, }; } catch (error: any) { throw new Error(error?.message || error || 'Unknown error loading board'); } } );

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/mattbalmer/knbn-mcp'

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