Skip to main content
Glama

get-membership-plans

Retrieve your membership plan details from note.com to view current subscription information and available options.

Instructions

自分のメンバーシッププラン一覧を取得する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the 'get-membership-plans' tool on the MCP server, including the inline handler function that fetches and formats membership plans from the Note API.
    server.tool( "get-membership-plans", "自分のメンバーシッププラン一覧を取得する", {}, async () => { try { if (!hasAuth()) { return createAuthErrorResponse(); } const data = await noteApiRequest("/v2/circle/plans", "GET", null, true); if (env.DEBUG) { console.error(`\n===== FULL Membership Plans API Response =====\n${JSON.stringify(data, null, 2)}`); } const rawPlans = safeExtractData(data, commonExtractors.plans); const formattedPlans = rawPlans.map(formatMembershipPlan); if (env.DEBUG) { console.error(`Formatted plans: ${formattedPlans.length} items`); if (formattedPlans.length > 0) { console.error(`First formatted plan: ${JSON.stringify(formattedPlans[0], null, 2)}`); } } return createSuccessResponse({ total: formattedPlans.length, plans: formattedPlans }); } catch (error) { return handleApiError(error, "メンバーシッププラン取得"); } } );
  • Helper function formatMembershipPlan used by the tool handler to format raw API response data into a standardized MembershipPlan structure.
    export function formatMembershipPlan(plan: any): MembershipPlan { const circle = plan.circle || {}; const circlePlans = plan.circlePlans || []; const owner = circle.owner || {}; return { id: circle.id || plan.id || "", key: circle.key || plan.key || "", name: circlePlans.length > 0 ? circlePlans[0].name || "" : circle.name || plan.name || "", description: circle.description || plan.description || "", price: plan.price || circle.price || 0, memberCount: circle.subscriptionCount || circle.membershipNumber || 0, notesCount: plan.notesCount || 0, status: circle.isCirclePublished ? "active" : "inactive", ownerName: owner.nickname || owner.name || "", headerImagePath: plan.headerImagePath || circle.headerImagePath || "", plans: circlePlans.map((p: any) => p.name || "").filter((n: string) => n), url: owner.customDomain ? `https://${owner.customDomain.host}/membership` : `https://note.com/${owner.urlname || ""}/membership` }; }
  • High-level registration entry point that calls registerMembershipTools(server), which registers the get-membership-plans tool.
    export function registerAllTools(server: McpServer): void { // 各カテゴリのツールを登録 registerSearchTools(server); registerNoteTools(server); registerUserTools(server); registerMembershipTools(server); registerMagazineTools(server);
  • Fallback/stub handler for HTTP transport version of the tool, directly calling a different API endpoint without formatting.
    } else if (name === "get-membership-plans") { // get-membership-plansツールの実装 const data = await noteApiRequest( `/v1/users/me/membership_plans`, "GET", null, true ); result = { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };

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/shimayuz/note-com-mcp'

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