Skip to main content
Glama
DavidLearning1023

bilibili-info-gathering

scan_untrusted_text

Scans arbitrary external text for prompt-injection indicators before an agent trusts or acts on it, returning flagged segments for manual review.

Instructions

注入检测(批次 C6 · 信任边界第二层):扫描任意外部文本。

为什么要有这个工具

前面所有通道的注入检测都发生在取数时。但有时文本不是从本项目取来的:

  • 别的 MCP 工具(上游 bilibili-mcp)返回的文本

  • 用户粘进来的网页/摘录

  • 你自己从别处复制的段落 这些都不经过 get_comments 的 sanitize ⇒ 不会被标记。 本工具让 Agent 能主动扫一遍。

⚠️ 命中不等于"这条在攻击 Agent":本检测是纯关键词匹配, 只能当"值得再看一眼"的提示,不能当证据。真正的判断要人/Agent 看原文。 误报是真实存在的(2026-10-21 实测:一条洛谷体长评因为「忽视」与「之前」 相隔很远而被独立匹配到一起,现已改成邻近匹配)。

返回:{n, flagged: [{index, risk, reasons, preview}], n_flagged, degraded}

Input Schema

NameRequiredDescriptionDefault
textsYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses the detection method (pure keyword matching), the known false-positive mode and a fixed example, the degraded flag, and the return shape. It omits anything about size limits, cost, or performance for large batches, which is the remaining gap for a batch tool.

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

Conciseness4/5

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

Front-loaded with the action and the trust-boundary rationale before the motivation section. Some redundancy in restating that other channels sanitize, and the prose is longer than needed, but every block contributes actionable context rather than filler.

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?

An output schema exists, yet the description still explains the result fields and their caveats, which is helpful for interpreting flagged results. For a one-parameter read-only scanner the coverage is nearly complete; only batch sizing and the meaning of the risk field's scale are unspecified.

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

Parameters3/5

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

Schema coverage is 0% for the single 'texts' array parameter, so the schema adds nothing. The description only indirectly conveys batch semantics via the return shape ({n, flagged:[{index, ...}]}), showing each input is scanned independently with per-item indices. It never states format, limits, or how previews are truncated.

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?

States a specific verb+resource: scan arbitrary external text for injection. It explicitly contrasts itself with the fetch-time sanitization done by get_comments, so an agent can tell which channel handles which text without opening the 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?

Enumerates concrete trigger scenarios (text from upstream bilibili-mcp, user-pasted pages/excerpts, self-copied passages) and explains that these bypass get_comments sanitization, so they will not be flagged otherwise. It also sets an interpretation boundary: a hit is a 'look again' hint, not evidence, and false positives are real (with a dated example).

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