Skip to main content
Glama
intounknown

MCP-Bocha

by intounknown

mcp-bocha_search

Search the web with time filters, domain inclusion/exclusion, and summarized results using Bocha AI's API. Ideal for retrieving targeted and relevant information efficiently.

Instructions

Search the web for information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
excludeNo
freshnessNo
includeNo
queryYes
summaryNo

Implementation Reference

  • The execute function that handles the tool logic by making a POST request to the Bocha AI web-search API, processes the response, and returns the web pages as content.
    execute: async (params) => {
      const response = await fetch("https://api.bochaai.com/v1/web-search", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: `Bearer ${apiKey}`,
        },
        body: JSON.stringify({
          ...params,
          include: params.include?.join(","),
          exclude: params.exclude?.join(","),
        }),
      });
    
      const {
        data: { webPages },
      } = await response.json();
    
      const result = [
        ...webPages.value.map((page: any) => ({
          type: "text",
          text: JSON.stringify(page),
        })),
      ];
    
      return {
        content: result,
      };
    },
  • Zod schema defining the input parameters for the mcp-bocha_search tool, including query, freshness, summary, include, exclude, and count.
    parameters: z.object({
      query: z.string(),
      freshness: z
        .enum(["oneDay", "oneWeek", "oneMonth", "oneYear", "noLimit"])
        .optional(),
      summary: z.boolean().optional(),
      include: z.array(z.string()).optional(),
      exclude: z.array(z.string()).optional(),
      count: z.number().optional(),
    }),
  • src/index.ts:13-55 (registration)
    Registration of the mcp-bocha_search tool using server.addTool, including name, description, parameters schema, and execute handler.
    server.addTool({
      name: "mcp-bocha_search",
      description: "Search the web for information",
      parameters: z.object({
        query: z.string(),
        freshness: z
          .enum(["oneDay", "oneWeek", "oneMonth", "oneYear", "noLimit"])
          .optional(),
        summary: z.boolean().optional(),
        include: z.array(z.string()).optional(),
        exclude: z.array(z.string()).optional(),
        count: z.number().optional(),
      }),
      execute: async (params) => {
        const response = await fetch("https://api.bochaai.com/v1/web-search", {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${apiKey}`,
          },
          body: JSON.stringify({
            ...params,
            include: params.include?.join(","),
            exclude: params.exclude?.join(","),
          }),
        });
    
        const {
          data: { webPages },
        } = await response.json();
    
        const result = [
          ...webPages.value.map((page: any) => ({
            type: "text",
            text: JSON.stringify(page),
          })),
        ];
    
        return {
          content: result,
        };
      },
    });
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action ('Search the web for information') without revealing any behavioral traits such as rate limits, authentication needs, output format, pagination, or error handling. This is inadequate for a tool with 6 parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at 4 words, with no wasted language. It's front-loaded and to the point, making it easy to parse quickly. Every word earns its place by conveying the core action, though it sacrifices detail for brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, 0% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, how results are structured, or any behavioral aspects. For a search tool with multiple filtering options, this minimal description leaves critical gaps in understanding how to effectively use it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, meaning none of the 6 parameters are documented in the schema. The description adds no meaning beyond the schema—it doesn't explain what parameters like 'count', 'freshness', or 'summary' do, nor does it clarify the purpose of arrays like 'include' and 'exclude'. With 0% coverage, the description fails to compensate for the lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Search the web for information' clearly states the verb ('Search') and resource ('the web'), making the purpose understandable. However, it's vague about what kind of information is searched (e.g., general web pages, specific content types) and doesn't differentiate from siblings (though none exist). It's not tautological but lacks specificity beyond basic action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or constraints. It simply states what it does without context for application. Since there are no sibling tools, this is less critical, but it still lacks any usage context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/intounknown/mcp-bocha'

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