Skip to main content
Glama
Selenium39

Qiita API MCP Server

get_item_comments

Retrieve comments for a specific Qiita article to analyze discussions and user feedback. Provide the article ID to access all associated comments.

Instructions

指定された記事のコメント一覧を取得します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdYes記事ID

Implementation Reference

  • Handler for the 'get_item_comments' tool. Parses arguments using itemIdSchema and delegates execution to the QiitaApiClient's getItemComments method.
    get_item_comments: {
      schema: itemIdSchema,
      execute: async ({ itemId }, client) => client.getItemComments(itemId),
    },
  • MCP tool definition including name, description, and JSON schema for input validation of 'get_item_comments'.
      name: 'get_item_comments',
      description: '指定された記事のコメント一覧を取得します',
      inputSchema: {
        type: 'object',
        properties: {
          itemId: {
            type: 'string',
            description: '記事ID',
          },
        },
        required: ['itemId'],
      },
    },
  • Core implementation that performs the API request to retrieve comments for the specified item ID.
    async getItemComments(itemId: string) {
      const response = await this.client.get(`/items/${itemId}/comments`);
      return response.data;
    }
  • src/index.ts:11-35 (registration)
    Imports toolHandlers and selects the handler by name during tool call request handling, effectively registering the 'get_item_comments' handler.
    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];

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