> ## 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_search

> Input, output and examples for the knowledge_search 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>

Search company knowledge, browse without query, or query records using typed filters and sorting. Results omit full bodies; cursors are bound to the query.

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

**Catalog:** Core (`tools/list`).

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}
{
  "$defs": {
    "filter": {
      "additionalProperties": false,
      "properties": {
        "and": {
          "items": {
            "additionalProperties": true,
            "description": "A nested filter using the same and/or/not or property_id/op/value shape. Boolean filters may nest up to 8 levels.",
            "type": "object"
          },
          "maxItems": 20,
          "type": "array"
        },
        "not": {
          "additionalProperties": true,
          "description": "A nested filter using the same and/or/not or property_id/op/value shape. Boolean filters may nest up to 8 levels.",
          "type": "object"
        },
        "op": {
          "enum": [
            "eq",
            "ne",
            "gt",
            "gte",
            "lt",
            "lte",
            "contains",
            "is_empty"
          ],
          "type": "string"
        },
        "or": {
          "items": {
            "additionalProperties": true,
            "description": "A nested filter using the same and/or/not or property_id/op/value shape. Boolean filters may nest up to 8 levels.",
            "type": "object"
          },
          "maxItems": 20,
          "type": "array"
        },
        "property_id": {
          "type": "string"
        },
        "value": {}
      },
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "area_id": {
      "format": "uuid",
      "type": "string"
    },
    "collection_id": {
      "format": "uuid",
      "type": "string"
    },
    "cursor": {
      "type": "string"
    },
    "filter": {
      "$ref": "#/$defs/filter"
    },
    "limit": {
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "type": "integer"
    },
    "property_ids": {
      "items": {
        "type": "string"
      },
      "maxItems": 50,
      "type": "array"
    },
    "query": {
      "type": "string"
    },
    "scope": {
      "enum": [
        "company",
        "area",
        "personal"
      ],
      "type": "string"
    },
    "sort": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "direction": {
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string"
          },
          "property_id": {
            "type": "string"
          }
        },
        "required": [
          "property_id",
          "direction"
        ],
        "type": "object"
      },
      "maxItems": 3,
      "type": "array"
    },
    "view_id": {
      "format": "uuid",
      "type": "string"
    }
  },
  "type": "object"
}
```

## Output

Matching accessible Library entries and search metadata.

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.

```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": "knowledge_search",
    "arguments": {}
  }
}
JSON
```


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