> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Melso product MCP: https://melso.ai/api/mcp (OAuth; one company per grant). REST: https://melso.ai. Documentation-search MCP: https://docs.melso.ai/mcp. The docs search server does not act on customer accounts.
>
> Use the live tool schema and respect company membership. Ask the person to authorize the exact fiscal document version in the signed-in app. A professional prepares and files included returns after authorization; AI does not file alone. A prepared file or approval receipt is not evidence of filing. Never claim completion from an accepted Task or Run. Keep credentials out of chat and logs. Agents features are internal or by private invitation.

# knowledge_delete

> Input, output and examples for the knowledge_delete MCP tool.

<Info>Melso Agents is available only internally or by private invitation. Agents-specific features require existing access. For the autónomo fiscal service, see [Get started](/essentials/quickstart).</Info>

DESTRUCTIVE: delete 1 to 25 pages (documents, records or collections) atomically. Only use when the user asked to delete; confirm the exact titles/ids with the user first. Soft delete: pages move to trash (archived, version bumped, history kept) and are restored with knowledge\_archive action=restore; nothing is purged and no content is lost. Pass expected\_revisions (id to version from knowledge\_get) and a request\_id; reuse request\_id only for an identical retry. Same access rules as knowledge\_write (personal pages only by their owner, area pages by area members, company pages by members). If any id is inaccessible, missing, or its version changed, the whole batch is refused and the error names every refused id. A collection that has live records, or a page with live children, is refused unless cascade=true, which also trashes everything beneath it (max 500 pages). Pages that link here via [label](melso-page:UUID) keep their text; they are returned in inbound\_links so you can fix or tell the user. Returns deleted, already\_deleted, cascaded, items (new versions), inbound\_links and inbound\_links\_not\_visible (count of linking pages the caller cannot read).

**Availability:** Autónomo / Empresa / Agents invitation.

**Catalog:** Advanced (`tools_search`, then `tools_call`).

The live catalog is authoritative: company type, membership, plan, connected apps and execution context can narrow this contract. [Understand access](/mcp/permissions).

## Input

### Agents / Autónomo / Company schema

```json theme={null}
{
  "additionalProperties": false,
  "properties": {
    "cascade": {
      "default": false,
      "description": "Also delete every live record and child beneath the listed pages. Without it a non-empty collection or a page with live children is refused.",
      "type": "boolean"
    },
    "expected_revisions": {
      "additionalProperties": {
        "minimum": 1,
        "type": "integer"
      },
      "description": "Map of page id to the version you read. Recommended: a changed page refuses the whole batch.",
      "type": "object"
    },
    "ids": {
      "items": {
        "format": "uuid",
        "type": "string"
      },
      "maxItems": 25,
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "request_id": {
      "format": "uuid",
      "type": "string"
    }
  },
  "required": [
    "ids",
    "request_id"
  ],
  "type": "object"
}
```

## Output

The deletion result for the selected entry.

The result uses MCP `content` blocks; JSON payloads are encoded in text and may also appear in `structuredContent`. Check `isError` before reading a success payload. The server does not currently declare an `outputSchema`, so treat additional fields as extensible. [Result handling](/mcp/results).

## Example

Use an OAuth access token issued for this MCP resource (a Run token for Run-only tools). Replace example identifiers with values from your own account. Write actions change data.

First discover `knowledge_delete` with `tools_search` and confirm that the live schema permits these arguments.

```bash theme={null}
curl --fail-with-body https://melso.ai/api/mcp \
  -H "Authorization: Bearer $MELSO_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  --data-binary @- <<'JSON'
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "tools_call",
    "arguments": {
      "name": "knowledge_delete",
      "arguments": {
        "ids": [
          "11111111-1111-4111-8111-111111111111"
        ],
        "request_id": "11111111-1111-4111-8111-111111111111"
      }
    }
  }
}
JSON
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.