get-circle-info
Retrieve circle information from note.com to access membership details and group data through API integration.
Instructions
サークル情報を取得する
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/membership-tools.ts:99-132 (handler)Handler function that authenticates the user, fetches circle information from the Note API endpoint '/v2/circle', formats the response data into a structured object, and returns it wrapped in a success response. Handles errors appropriately.async () => { try { if (!hasAuth()) { return createAuthErrorResponse(); } const data = await noteApiRequest("/v2/circle", "GET", null, true); if (env.DEBUG) { console.error(`\nCircle Info API Response:\n${JSON.stringify(data, null, 2)}`); } const circleData = data.data || {}; const formattedCircleInfo = { id: circleData.id || "", name: circleData.name || "", description: circleData.description || "", urlname: circleData.urlname || "", iconUrl: circleData.icon_url || "", createdAt: circleData.created_at || "", updatedAt: circleData.updated_at || "", isPublic: circleData.is_public || false, planCount: circleData.plan_count || 0, memberCount: circleData.member_count || 0, noteCount: circleData.note_count || 0, userId: circleData.user_id || "" }; return createSuccessResponse(formattedCircleInfo); } catch (error) { return handleApiError(error, "サークル情報取得"); } }
- src/tools/membership-tools.ts:95-133 (registration)Registers the 'get-circle-info' tool on the MCP server with a description in Japanese, empty input schema (no parameters), and the inline handler function.server.tool( "get-circle-info", "サークル情報を取得する", {}, async () => { try { if (!hasAuth()) { return createAuthErrorResponse(); } const data = await noteApiRequest("/v2/circle", "GET", null, true); if (env.DEBUG) { console.error(`\nCircle Info API Response:\n${JSON.stringify(data, null, 2)}`); } const circleData = data.data || {}; const formattedCircleInfo = { id: circleData.id || "", name: circleData.name || "", description: circleData.description || "", urlname: circleData.urlname || "", iconUrl: circleData.icon_url || "", createdAt: circleData.created_at || "", updatedAt: circleData.updated_at || "", isPublic: circleData.is_public || false, planCount: circleData.plan_count || 0, memberCount: circleData.member_count || 0, noteCount: circleData.note_count || 0, userId: circleData.user_id || "" }; return createSuccessResponse(formattedCircleInfo); } catch (error) { return handleApiError(error, "サークル情報取得"); } } );
- src/tools/index.ts:20-20 (registration)Calls registerMembershipTools which includes the registration of get-circle-info among other membership tools.registerMembershipTools(server);