Skip to main content
Glama
Selenium39

Qiita API MCP Server

create_comment

Add comments to Qiita articles using Markdown formatting. Specify the article ID and comment body to contribute to developer discussions.

Instructions

指定された記事にコメントを作成します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemIdYes記事ID
bodyYesコメントの本文(Markdown形式)

Implementation Reference

  • The handler definition for the 'create_comment' tool, including Zod input schema validation and execution logic that delegates to the QiitaApiClient.
    create_comment: {
      schema: z.object({
        itemId: z.string(),
        body: z.string(),
      }),
      execute: async ({ itemId, body }, client) => client.createComment(itemId, body),
    },
  • The MCP Tool definition for 'create_comment', providing the JSON input schema, description, and metadata used for tool listing.
    {
      name: 'create_comment',
      description: '指定された記事にコメントを作成します',
      inputSchema: {
        type: 'object',
        properties: {
          itemId: {
            type: 'string',
            description: '記事ID',
          },
          body: {
            type: 'string',
            description: 'コメントの本文(Markdown形式)',
          },
        },
        required: ['itemId', 'body'],
      },
    },
  • The QiitaApiClient method implementing the core logic to create a comment via HTTP POST to the Qiita API.
    async createComment(itemId: string, body: string) {
      this.assertAuthenticated();
      const response = await this.client.post(`/items/${itemId}/comments`, { body });
      return response.data;
    }
  • src/index.ts:30-65 (registration)
    The generic tool execution handler registration in the MCP server, which dispatches to specific tool handlers based on name, including 'create_comment' via toolHandlers[name].
    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,
        };
      }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states it creates a comment, implying a write operation, but doesn't disclose behavioral traits like authentication requirements, rate limits, side effects (e.g., notifications), or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Japanese that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every part contributing to understanding the action and target.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool is a mutation (creates a comment) with no annotations, no output schema, and 100% schema coverage, the description is incomplete. It lacks details on authentication, response format, error handling, or interaction with siblings (e.g., 'get_item_comments'). For a write operation, more context is needed to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('itemId', 'body') fully documented in the schema. The description adds no additional meaning beyond the schema, such as format details for 'itemId' or examples for 'body'. Baseline is 3 since the schema does the heavy lifting, but no extra value is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('作成します' - creates) and target resource ('コメント' - comment) with context ('指定された記事に' - on the specified article). It distinguishes from siblings like 'update_comment' or 'delete_comment' by specifying creation, but doesn't explicitly differentiate from other creation tools like 'create_item' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication), when not to use it, or compare with related tools like 'update_comment' for editing or 'get_item_comments' for reading. The description only states what it does, not when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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