Skip to main content
Glama

get_user_stocks

Retrieve a user's saved articles from Qiita by providing their user ID, with options to paginate results for efficient browsing.

Instructions

指定されたユーザーのストック一覧を取得します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesユーザーID
pageNoページ番号(1-100)
perPageNo1ページあたりの件数(1-100)

Implementation Reference

  • Handler definition for the 'get_user_stocks' tool. It defines the Zod schema by merging userId and pagination schemas, and provides an execute function that calls the QiitaApiClient's getUserStocks method with the parsed input.
    get_user_stocks: { schema: userIdSchema.merge(paginationSchema), execute: async ({ userId, page, perPage }, client) => client.getUserStocks(userId, page, perPage), },
  • MCP Tool definition for 'get_user_stocks', including the name, description, and inputSchema specifying parameters: userId (required string), page and perPage (optional numbers with defaults).
    { name: 'get_user_stocks', description: '指定されたユーザーのストック一覧を取得します', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'ユーザーID', }, page: { type: 'number', description: 'ページ番号(1-100)', default: 1, }, perPage: { type: 'number', description: '1ページあたりの件数(1-100)', default: 20, }, }, required: ['userId'], }, },
  • Core implementation of getUserStocks in QiitaApiClient class. Makes an authenticated GET request to Qiita API endpoint /users/{userId}/stocks with pagination params and returns the response data.
    async getUserStocks(userId: string, page = 1, perPage = 20) { const response = await this.client.get(`/users/${userId}/stocks`, { params: { page, per_page: perPage }, }); return response.data; }

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