Skip to main content
Glama

browse

Open the default browser to view detailed information about a Douban book using its unique identifier.

Instructions

open default browser and browse douban book detail

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesdouban book id, e.g. "1234567890"

Implementation Reference

  • Handler function for the 'browse' tool. It validates the required 'id' parameter, opens the corresponding Douban book detail page in the default browser using the 'open' package, and returns a confirmation text message.
    async (args) => { if (!args.id) { throw new McpError(ErrorCode.InvalidParams, "douban book id must be provided") } await open(`https://book.douban.com/subject/${args.id}/`); return { content: [{ type: "text", text: `The Douban Book Page has been opened in your default browser`, }] } }
  • Input schema for the 'browse' tool using Zod: defines a required 'id' string parameter for the Douban book ID.
    { id: z.string().describe('douban book id, e.g. "1234567890"') },
  • src/index.ts:183-203 (registration)
    Registration of the 'browse' tool on the MCP server, including tool name (TOOL.BROWSE), description, input schema, and inline handler function.
    server.tool( TOOL.BROWSE, "open default browser and browse douban book detail", { id: z.string().describe('douban book id, e.g. "1234567890"') }, async (args) => { if (!args.id) { throw new McpError(ErrorCode.InvalidParams, "douban book id must be provided") } await open(`https://book.douban.com/subject/${args.id}/`); return { content: [{ type: "text", text: `The Douban Book Page has been opened in your default browser`, }] } } );
  • Definition of the TOOL.BROWSE constant in the TOOL enum, providing the string identifier 'browse' used in tool registration.
    BROWSE = 'browse',

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/moria97/douban-mcp'

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