Skip to main content
Glama

follow_tag

Subscribe to specific tags on Qiita to receive updates and discover relevant developer content in your feed.

Instructions

指定されたタグをフォローします

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagIdYesタグID

Implementation Reference

  • The handler for the 'follow_tag' tool. It uses tagIdSchema for input validation and delegates execution to QiitaApiClient.followTag(tagId).
    follow_tag: { schema: tagIdSchema, execute: async ({ tagId }, client) => client.followTag(tagId), },
  • MCP tool definition for 'follow_tag' including the input JSON schema requiring a 'tagId' string.
    { name: 'follow_tag', description: '指定されたタグをフォローします', inputSchema: { type: 'object', properties: { tagId: { type: 'string', description: 'タグID', }, }, required: ['tagId'], }, },
  • src/index.ts:26-28 (registration)
    Registration of the tool list request handler, which returns the tools array containing 'follow_tag'.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
  • src/index.ts:30-65 (registration)
    Registration of the call tool request handler, which dynamically dispatches to toolHandlers[name].execute for 'follow_tag'.
    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, }; } });
  • The QiitaApiClient method that performs the actual API call to follow the specified tag.
    async followTag(tagId: string) { this.assertAuthenticated(); await this.client.put(`/tags/${tagId}/following`); return { success: true }; }

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/Selenium39/mcp-server-qiita'

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