Skip to main content
Glama

Search Bilibili videos

search_videos

Search Bilibili for learning videos by keyword and return titles, creators, BV IDs, durations, view counts, and links so users can choose a tutorial or course.

Instructions

在 B 站搜索学习类视频,返回标题、UP主、BV号、时长、播放量和链接。

何时调用:
    - 用户想找某个主题的教程、课程或讲解,而手上还没有具体视频时,先用本工具。
    - 需要给用户一份候选清单让他挑选时。
    - 已经知道 BV 号时不要用本工具,直接调用 get_video_info。

参数:
    keyword: 搜索关键词,建议 1-4 个词,例如 "线性代数 期末速成"、"MIT 6.824"。
        支持中英文和空格;不要传 URL 或 BV 号。无需 Cookie 也能搜索,
        配置 Cookie 可提高被风控时的成功率。
    limit: 返回条数,范围 1-50,默认 5。给用户做选择时 5-10 条足够。

返回示例:
    搜索「线性代数」找到 2 个视频:

    1. 线性代数 期末速成(4小时)
       UP主:某老师 | 时长:4:12:30 | 播放:120.5万
       BV号:BV1xx411c7mD
       链接:https://www.bilibili.com/video/BV1xx411c7mD

失败时:
    返回以「搜索失败:」开头的中文说明。搜索可匿名使用;若被 B 站风控拦截,
    会提示配置 BILIBILI_COOKIE。请把配置方法转告用户,不要用相同参数反复重试。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "keyword": "<keyword>"
    },
    "name": "search_videos"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
keywordYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden and does substantial work: it discloses that search works anonymously without Cookie, that a Cookie raises the success rate under B站 risk control, that failures return a Chinese message prefixed 「搜索失败:」, and that the agent should tell the user how to configure BILIBILI_COOKIE rather than retry with identical parameters. That is genuine operational context rarely found in a schema. It still leaves gaps on throttling behavior and on whether results are cached or ranked, which keeps it below the top of the scale for a zero-annotation tool with a real rate-limiting failure mode.

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

Conciseness3/5

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

The headed sections (何时调用 / 参数 / 返回示例 / 失败时) front-load the important material and make the text scannable. However, the 返回示例 block reproduces return values that an output schema already covers, including a full five-line sample entry, adding length without new decision-relevant information. There is also mild repetition between the Cookie note in 参数 and the Cookie/风控 note in 失败时.

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

Completeness4/5

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

For a two-parameter read tool with a sibling family, the description supplies selection logic, parameter boundaries, the anonymous-auth posture, and the failure contract, which is nearly everything an agent needs to call it correctly. The only real shortfall is that failure/风控 handling is described qualitatively without saying what a successful-but-empty result looks like, which the return example does not disambiguate.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate entirely and it does: keyword gets length advice (1-4 words), language support (中英文和空格), worked examples ("线性代数 期末速成", "MIT 6.824"), and a prohibition on passing URLs or BV numbers. limit gets an explicit 1-50 range, the default of 5, and situational advice (5-10 sufficient when offering the user a choice), which the bare default=5 in the schema cannot convey.

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

Purpose5/5

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

The opening sentence pairs a specific verb (搜索/search) with a specific resource and scope (B站学习类视频), and enumerates exactly what comes back (标题、UP主、BV号、时长、播放量、链接). It explicitly differentiates itself from the sibling get_video_info by ruling out the BV-number lookup case, so an agent can pick between them without opening either schema.

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

Usage Guidelines5/5

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

A dedicated 何时调用 block gives three positive triggers (no concrete video yet in hand, need a candidate list for the user to pick from) and one explicit exclusion routing to get_video_info when the BV number is already known. Both directions of the decision are stated, not inferred.

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