Skip to main content
Glama
setRichMenuDefault.ts1.02 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { messagingApi } from "@line/bot-sdk"; import { createSuccessResponse } from "../common/response.js"; import { AbstractTool } from "./AbstractTool.js"; import { z } from "zod"; export default class SetRichMenuDefault extends AbstractTool { private client: messagingApi.MessagingApiClient; constructor(client: messagingApi.MessagingApiClient) { super(); this.client = client; } register(server: McpServer) { const richMenuIdSchema = z .string() .describe("The ID of the rich menu to set as default."); server.tool( "set_rich_menu_default", "Set a rich menu as the default rich menu.", { richMenuId: richMenuIdSchema.describe( "The ID of the rich menu to set as default.", ), }, async ({ richMenuId }) => { const response = await this.client.setDefaultRichMenu(richMenuId); return createSuccessResponse(response); }, ); } }

Implementation Reference

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/tndfame/mcp_management'

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