Skip to main content
Glama

Backlog MCP Server

getWikisCount.ts1.48 kB
import { z } from 'zod'; import { Backlog } from 'backlog-js'; import { buildToolSchema, ToolDefinition } from '../types/tool.js'; import { TranslationHelper } from '../createTranslationHelper.js'; import { WikiCountSchema } from '../types/zod/backlogOutputDefinition.js'; import { resolveIdOrKey } from '../utils/resolveIdOrKey.js'; const getWikisCountSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_WIKIS_COUNT_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_WIKIS_COUNT_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), })); export const getWikisCountTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getWikisCountSchema>, (typeof WikiCountSchema)['shape'] > => { return { name: 'get_wikis_count', description: t( 'TOOL_GET_WIKIS_COUNT_DESCRIPTION', 'Returns count of wiki pages in a project' ), schema: z.object(getWikisCountSchema(t)), outputSchema: WikiCountSchema, handler: async ({ projectId, projectKey }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.getWikisCount(result.value); }, }; };

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/nulab/backlog-mcp-server'

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