# listDocuments

List AND grep documents in a project, workspace, or folder. query does a full-content search across each document's body (not just the title) and returns the matching lines — like grep across your docs. Each returned document includes contentMatches: [{line, text, context?}] and matchCount; the text is anchor-ready (paste it straight into editDocument's oldText). Use isRegex:true for regular-expression search (e.g. "TODO\(.*\)", "ACME-\d+"), caseSensitive for exact case, and contextLines for surrounding lines (grep -C). versionTimestamp is returned per document so you can edit straight from the results without a getDocument round-trip. Also supports date filtering.

Agent View of the PolicyLayer registry record for `listDocuments`. HTML page: https://policylayer.com/tools/io-stablebaseline-sb/listdocuments

## Facts

- Tool: `listDocuments`
- Server: Stable Baseline (`https://api.stablebaseline.io/functions/v1/cloud-serve/mcp`) — https://policylayer.com/tools/io-stablebaseline-sb.md
- Homepage: https://github.com/stablebaseline/mcp
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server CORS policy: https://app.stablebaseline.io
- Server rate-limited: no
- Parameters: 12
- Recommended policy verdict: Allowed

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | number | no |  |
| `query` | string | no | Search text. Matched against title, friendlyId AND full document content. Returns the matching lines per document (grep). Case-insensitive unless caseSensitive: |
| `fields` | array | no | Field projection for the document metadata. Valid fields: id, title, friendlyId, friendlyIdNumber, projectId, folderId, createdAt, updatedAt, href. (contentMatc |
| `offset` | number | no |  |
| `toDate` | string | no | ISO 8601 date filter (to). |
| `isRegex` | boolean | no | Treat `query` as a JavaScript regular expression (grep -E). Default false (literal substring). Regex search requires a project/workspace/folder scope and scans |
| `folderId` | string | no |  |
| `fromDate` | string | no | ISO 8601 date filter (from). |
| `dateField` | string | no | Date field to filter. Default: updated_at. |
| `projectId` | string | no |  |
| `workspaceId` | string | no |  |
| `contextLines` | number | no | Lines of surrounding context to include with each match (grep -C). 0-5, default 0. |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "listDocuments",
    "arguments": {}
  }
}
```

## Why listDocuments is rated Low

This tool performs search and retrieval operations only. It returns document content and metadata but does not create, modify, delete, or execute anything. The mention of parameters like `query`, `isRegex`, `caseSensitive`, and `contextLines` are all for filtering and presenting existing data, not transforming it. This is a classic Read operation.

From the tool's own definition: "Tool description explicitly states 'List AND grep documents' and 'full-content search across each document's body'."

Risk signals: High parameter count (14 properties)

## Use case

AI agents call listDocuments to retrieve information from Stable Baseline without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Stable Baseline:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "listDocuments": {}
  }
}
```

## Other tools on Stable Baseline (195)

- `cancelAllKgInScope` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/cancelallkginscope.md
- `cancelKgBuildBatch` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/cancelkgbuildbatch.md
- `deleteDiagramInDocument` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deletediagramindocument.md
- `deleteDocument` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deletedocument.md
- `deleteFolder` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deletefolder.md
- `deleteImageInDocument` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteimageindocument.md
- `deleteImprovement` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteimprovement.md
- `deleteImprovementCategory` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteimprovementcategory.md
- `deleteImprovementComment` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteimprovementcomment.md
- `deletePlan` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteplan.md
- `deletePlanComment` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteplancomment.md
- `deletePlanPhase` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteplanphase.md
- `deleteResourcePermission` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteresourcepermission.md
- `deleteTaskDependency` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deletetaskdependency.md
- `deleteTeam` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deleteteam.md
- `deleteVegaDataFile` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deletevegadatafile.md
- `deleteWhiteboard` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/deletewhiteboard.md
- `removeMember` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/removemember.md
- `removeTeamMember` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/removeteammember.md
- `removeWorkspaceMember` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/removeworkspacemember.md
- `resetDocumentInBrain` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/resetdocumentinbrain.md
- `revokeTeamWorkspaceAccess` — Destructive — https://policylayer.com/tools/io-stablebaseline-sb/revoketeamworkspaceaccess.md
- `autoDesignWhiteboard` — Execute — https://policylayer.com/tools/io-stablebaseline-sb/autodesignwhiteboard.md
- `renderDiagram` — Execute — https://policylayer.com/tools/io-stablebaseline-sb/renderdiagram.md
- `startMeetingScribe` — Execute — https://policylayer.com/tools/io-stablebaseline-sb/startmeetingscribe.md
- `stopMeetingScribe` — Execute — https://policylayer.com/tools/io-stablebaseline-sb/stopmeetingscribe.md
- `triggerKgRebuild` — Execute — https://policylayer.com/tools/io-stablebaseline-sb/triggerkgrebuild.md
- `applySubscriptionChange` — Financial — https://policylayer.com/tools/io-stablebaseline-sb/applysubscriptionchange.md
- `cancelSubscription` — Financial — https://policylayer.com/tools/io-stablebaseline-sb/cancelsubscription.md
- `getCustomerPortalLink` — Financial — https://policylayer.com/tools/io-stablebaseline-sb/getcustomerportallink.md
- …and 165 more: https://policylayer.com/tools/io-stablebaseline-sb.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=io-stablebaseline-sb · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/io-stablebaseline-sb
