Skip to main content
Glama
moria97
by moria97

browse

Open your browser to view detailed information about a specific Douban book using its unique ID.

Instructions

open default browser and browse douban book detail

Input Schema

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

Implementation Reference

  • Handler function that validates the book ID, opens the Douban book detail page in the default browser using the 'open' package, and returns a confirmation 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`,
        }]
      }
    }
  • Zod schema for the tool input, defining the required 'id' parameter as a string.
    {
      id: z.string().describe('douban book id, e.g. "1234567890"')
    },
  • src/index.ts:183-203 (registration)
    Registers the 'browse' tool on the MCP server with name TOOL.BROWSE, description, input schema, and 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`,
          }]
        }
      }
    );
  • TypeScript enum TOOL defining the constant BROWSE = 'browse' used as the tool name in registration.
    export enum TOOL {
      SEARCH_BOOK = 'search-book',
      LIST_BOOK_REVIEWS = 'list-book-reviews',
      SEARCH_MOVIE = 'search-movie',
      LIST_MOVIE_REVIEWS = 'list-movie-reviews',
      BROWSE = 'browse',
      LIST_GROUP_TOPICS = 'list-group-topics',
      GET_GROUP_TOPIC_DETAIL = 'get-group-topic-detail'
    }

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