Skip to main content
Glama

get_my_qiita_articles

Retrieve authenticated user's Qiita articles with pagination support using the MCP server tool, enabling access to articles based on page number and items per page.

Instructions

get current authenticated user qiita articles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
per_pageNoNumber of items per page

Implementation Reference

  • Main handler function that executes the tool logic: fetches paginated list of current user's Qiita articles via QiitaApiService, formats as JSON response or error.
    const getMyQiitaUserArticles = async (params: GetUserArticlesParams): Promise<any> => { try { const { page = 1, per_page = 20 } = params; const items = await apiService.getAuthenticatedUserItems(page, per_page); return createSuccessResponse(JSON.stringify(items, null, 2)); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return createErrorResponse(`Error fetching Qiita items: ${errorMessage}`); } };
  • Zod schema defining input parameters for the tool: optional page (default 1) and per_page (default 20).
    const getUserArticlesSchema = z.object({ page: z.number().optional().default(1).describe("Page number for pagination"), per_page: z.number().optional().default(20).describe("Number of items per page"), });
  • Tool definition object within getToolDefinitions() array, specifying name, description, parameters, and handler reference.
    { name: "get_my_qiita_articles", description: "get current authenticated user qiita articles", parameters: getUserArticlesSchema.shape, handler: (params: GetUserArticlesParams) => getMyQiitaUserArticles(params) },
  • src/index.ts:19-21 (registration)
    MCP server registration loop that calls server.tool() for each tool definition from qiitaTools.ts.
    getToolDefinitions().forEach(({ name, description, parameters, handler }) => { server.tool(name, description, parameters, handler); });
  • QiitaApiService method implementing the core API call to fetch authenticated user's items, with token validation, error handling, and response filtering.
    getAuthenticatedUserItems = async (page: number = 1, per_page: number = 20): Promise<any[]> => { this.validateToken(); const response = await fetch( `${this.baseUrl}/authenticated_user/items?page=${page}&per_page=${per_page}`, { headers: this.getHeaders() } ); if (!response.ok) { await this.handleErrorResponse(response); } const items = await response.json(); return this.filterItems(items); };

Other Tools

Related 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/2bo/qiita-mcp-server'

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