get_tag
Retrieve detailed information about a specific tag from the Qiita developer community platform. Use this tool to access tag metadata and descriptions for content organization.
Instructions
指定されたタグの詳細情報を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tagId | Yes | タグID |
Implementation Reference
- src/tools/handlers.ts:132-135 (handler)Handler definition for the 'get_tag' tool, including its Zod input schema reference and execute function that calls the Qiita client's getTag method.get_tag: { schema: tagIdSchema, execute: async ({ tagId }, client) => client.getTag(tagId), },
- src/tools/definitions.ts:384-397 (schema)MCP Tool schema definition for 'get_tag', used in listTools response, specifying name, description, and JSON schema for input (tagId).{ name: 'get_tag', description: '指定されたタグの詳細情報を取得します', inputSchema: { type: 'object', properties: { tagId: { type: 'string', description: 'タグID', }, }, required: ['tagId'], }, },
- src/qiitaApiClient.ts:144-147 (helper)Qiita API client method that performs the HTTP GET request to retrieve details of a specific tag.async getTag(tagId: string) { const response = await this.client.get(`/tags/${tagId}`); return response.data; }
- src/tools/handlers.ts:23-25 (schema)Zod schema definition for tagId input, reused by 'get_tag' and other tag-related tools for input validation.const tagIdSchema = z.object({ tagId: z.string(), });
- src/index.ts:30-65 (registration)Server request handler for calling any tool, including 'get_tag', which retrieves the handler from toolHandlers map, validates input, executes it with Qiita client, and returns result.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const accessToken = process.env.QIITA_ACCESS_TOKEN; const qiita = new QiitaApiClient(accessToken); const handler = toolHandlers[name]; try { if (!handler) { throw new Error(`未知のツール: ${name}`); } const parsedArgs = handler.schema.parse(args ?? {}); const result = await handler.execute(parsedArgs, qiita); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } catch (error: any) { const message = error?.message ?? String(error); return { content: [ { type: 'text', text: `エラーが発生しました: ${message}`, }, ], isError: true, }; } });