superdoc_search
Find text patterns or nodes in the document and get ref handles for targeting edits and formatting. Refs expire after any mutation that changes the document. Re-search before the next edit when using individual tools (superdoc_edit, superdoc_format). Within a superdoc_mutations batch, selectors i...
This record as markdown: /tools/superdoc-mcp/superdoc-search.md
What superdoc_search does on Superdoc
AI agents call superdoc_search to retrieve information from Superdoc without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
in | object | — | Story scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, e |
mode | string | — | Search mode: 'strict' (default, exact matching) or 'candidates' (returns scored potential matches). |
limit | integer | — | Maximum number of matches to return. |
offset | integer | — | Number of matches to skip for pagination. |
select | object | Yes | Search selector. Use {type:'text', pattern:'...'} for text search or {type:'node', nodeType:'paragraph'|'heading'|...} for node search. |
within | object | — | Limit search scope to within a specific block: {kind:'block', nodeType:'...', nodeId:'...'}. |
require | string | — | Match cardinality: 'any' (all matches), 'first' (only first), 'exactlyOne' (fail if != 1), 'all' (fail if 0). |
session_id | string | Yes | Session ID from superdoc_open. |
includeNodes | boolean | — | When true, includes full node data in results. Default: false. |
Parameters from the server's own tool schema.
Why superdoc_search is rated Low
Even though superdoc_search only reads data, uncontrolled read access leaks sensitive information and racks up API costs: an agent caught in a retry loop can make thousands of calls a minute without anyone noticing.
Risk signalsHigh parameter count (13 properties)
Attacks that exploit this kind of access
The rule that runs superdoc_search safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Superdoc, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For superdoc_search, this is the rule to start with:
superdoc_search is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Superdoc, apply this rule, and every superdoc_search call is checked against it from then on.
Questions about superdoc_search
Find text patterns or nodes in the document and get ref handles for targeting edits and formatting. Refs expire after any mutation that changes the document. Re-search before the next edit when using individual tools (superdoc_edit, superdoc_format). Within a superdoc_mutations batch, selectors in "where" clauses resolve automatically at compile time; no manual re-searching needed between steps. Text search returns handle.ref covering only the matched substring. Node search finds blocks by type (paragraph, heading, table, listItem, etc.). The "require" parameter controls match cardinality: "first" returns one match, "all" returns every match, "exactlyOne" fails if not exactly one match. Supports scoping via "within" to search inside a single block. Patterns are plain text by default; pass select.mode: "regex" for regular-expression search (g/gi semantics, 1024-char cap, no wholeWord, capture groups returned on matches). Invalid or unsafe patterns fail with INVALID_INPUT. Do NOT use markdown formatting markers (#, , etc.) in search patterns. Do NOT use this tool when you already have a ref from superdoc_get_content blocks or superdoc_create; use that ref directly. EXAMPLES: 1. {"select":{"type":"text","pattern":"Introduction"},"require":"first"} 2. {"select":{"type":"text","pattern":"total amount"},"require":"all"} 3. {"select":{"type":"node","nodeType":"heading"},"require":"all"} 4. {"select":{"type":"text","pattern":"contract"},"within":{"kind":"block","nodeType":"paragraph","nodeId":"abc123"},"require":"first"}. It is categorised as a Read tool in the Superdoc MCP Server, which means it retrieves data without modifying state.
superdoc_search accepts 9 parameters: in, mode, limit, offset, select, within, require, session_id, includeNodes. Required: select, session_id. The full parameter table on this page comes from the server's own tool schema.
Register the Superdoc MCP server in PolicyLayer and add a rule for superdoc_search: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Superdoc. Nothing to install.
superdoc_search is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the superdoc_search rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for superdoc_search. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
superdoc_search is provided by the Superdoc MCP server (@superdoc/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Superdoc, and thousands of servers like it.
This server
Across the catalogue