follow_tag
Follow specific tags on Qiita to receive updates and discover relevant content from the Japanese developer community platform.
Instructions
指定されたタグをフォローします
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tagId | Yes | タグID |
Implementation Reference
- src/tools/handlers.ts:141-144 (handler)The handler for the 'follow_tag' tool. It validates the input using tagIdSchema and executes the followTag method on the Qiita API client.follow_tag: { schema: tagIdSchema, execute: async ({ tagId }, client) => client.followTag(tagId), },
- src/tools/handlers.ts:23-25 (schema)Zod schema definition for tagId input parameter used in the follow_tag handler and other tag-related tools.const tagIdSchema = z.object({ tagId: z.string(), });
- src/tools/definitions.ts:423-435 (schema)Tool metadata including name, description, and JSON input schema provided in the MCP listTools response.name: 'follow_tag', description: '指定されたタグをフォローします', inputSchema: { type: 'object', properties: { tagId: { type: 'string', description: 'タグID', }, }, required: ['tagId'], }, },
- src/qiitaApiClient.ts:156-160 (helper)Implementation of the followTag method in the Qiita API client, which sends a PUT request to the Qiita API to follow the specified tag.async followTag(tagId: string) { this.assertAuthenticated(); await this.client.put(`/tags/${tagId}/following`); return { success: true }; }
- src/index.ts:11-36 (registration)Registration of tools via the toolHandlers object imported and dynamically dispatched in the MCP server request handler for CallToolRequest.import { toolHandlers } from './tools/handlers.js'; import { tools } from './tools/definitions.js'; const server = new Server( { name: 'mcp-server-qiita', version: '1.0.0', }, { capabilities: { tools: {}, }, } ); server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; }); 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];