Skip to main content
Glama

get_items_by_user

Retrieve articles written by a specific Qiita user. Provide the user ID to access their published content with pagination support for browsing multiple pages.

Instructions

Get articles written by a specific user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idYesUser ID
pageNoPage number (1-100, default: 1)
per_pageNoItems per page (1-100, default: 20)

Implementation Reference

  • Core handler function in QiitaClient that fetches and returns Qiita items authored by a specific user via the API.
    async getItemsByUser(
      userId: string,
      page: number = 1,
      perPage: number = 20
    ): Promise<any[]> {
      const params = new URLSearchParams({
        page: page.toString(),
        per_page: perPage.toString(),
      });
    
      return this.fetch(`/users/${userId}/items?${params.toString()}`);
    }
  • Input schema definition for the get_items_by_user tool, specifying parameters and validation.
    inputSchema: {
      type: "object",
      properties: {
        user_id: {
          type: "string",
          description: "User ID",
        },
        page: {
          type: "number",
          description: "Page number (1-100, default: 1)",
          minimum: 1,
          maximum: 100,
        },
        per_page: {
          type: "number",
          description: "Items per page (1-100, default: 20)",
          minimum: 1,
          maximum: 100,
        },
      },
      required: ["user_id"],
    },
  • src/index.ts:192-217 (registration)
    Tool registration in the tools array, defining name, description, and schema for list tools response.
    {
      name: "get_items_by_user",
      description: "Get articles written by a specific user.",
      inputSchema: {
        type: "object",
        properties: {
          user_id: {
            type: "string",
            description: "User ID",
          },
          page: {
            type: "number",
            description: "Page number (1-100, default: 1)",
            minimum: 1,
            maximum: 100,
          },
          per_page: {
            type: "number",
            description: "Items per page (1-100, default: 20)",
            minimum: 1,
            maximum: 100,
          },
        },
        required: ["user_id"],
      },
    },
  • Dispatch handler in the CallToolRequestSchema handler that validates input and calls the QiitaClient method for get_items_by_user.
    case "get_items_by_user": {
      if (!args?.user_id) {
        throw new Error("user_id is required");
      }
      const result = await qiitaClient.getItemsByUser(
        args.user_id as string,
        args?.page as number | undefined,
        args?.per_page as number | undefined
      );
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
  • Helper fetch method used by QiitaClient methods to make authenticated API requests to Qiita.
    private async fetch(endpoint: string): Promise<any> {
      const headers: HeadersInit = {
        "Content-Type": "application/json",
      };
    
      if (this.accessToken) {
        headers["Authorization"] = `Bearer ${this.accessToken}`;
      }
    
      const response = await fetch(`${this.baseUrl}${endpoint}`, { headers });
    
      if (!response.ok) {
        const errorBody = await response.text();
        throw new Error(
          `Qiita API error: ${response.status} ${response.statusText} - ${errorBody}`
        );
      }
    
      return response.json();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but lacks details on permissions, rate limits, pagination behavior (beyond what the schema implies), or response format. This is inadequate for a tool with multiple parameters and no output schema.

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, clear sentence with no wasted words. It's front-loaded with the core purpose, making it efficient and easy to parse, which is ideal for conciseness.

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 has 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the return values (e.g., article details), error conditions, or usage nuances, leaving significant gaps for an AI agent to operate 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?

The schema description coverage is 100%, so the schema already documents all parameters (user_id, page, per_page) with descriptions and constraints. The description adds no additional meaning beyond implying user-based filtering, which is redundant with the schema, meeting the baseline for high coverage.

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 verb ('Get') and resource ('articles written by a specific user'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_items_by_tag' or 'search_items', which also retrieve items but with different filters, so it falls short of a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't mention when to choose 'get_items_by_user' over 'search_items' for user-specific queries or 'get_item' for individual articles, leaving the agent without context for selection.

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

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