# List Deal messages

`deal_records.list_messages`

List messages in one Deal communication thread without changing read state. First call deal_records.list_communications with the same deal_id, then pass an exact returned thread_key.

[Deal administration guide](https://docs.levr.ai/mcp/resources/deal_records.md)

Availability depends on live discovery and your access to the record. Do not infer MCP calls from REST paths.

Operation: read. Required OAuth scopes: mcp.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "cursor": {
      "anyOf": [
        {
          "description": "Opaque next_cursor from the preceding page with the same query.",
          "maxLength": 4096,
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Opaque next_cursor from the preceding page with the same query."
    },
    "deal_id": {
      "description": "Stable public identifier for the referenced resource.",
      "maxLength": 255,
      "minLength": 1,
      "pattern": "^dapp_[A-Za-z0-9_-]+$",
      "type": "string"
    },
    "ordering": {
      "default": "created_at",
      "description": "Comma-separated ordering fields. Prefix a field with - for descending order. Allowed fields: created_at.",
      "maxLength": 255,
      "minLength": 1,
      "pattern": "^-?(?:created_at)(?:,-?(?:created_at)){0,2}$",
      "type": "string"
    },
    "page_size": {
      "default": 20,
      "description": "Maximum items to return. The allowed range is 1 through 50.",
      "maximum": 50,
      "minimum": 1,
      "type": "integer"
    },
    "thread_key": {
      "maxLength": 255,
      "type": "string"
    }
  },
  "required": [
    "deal_id",
    "thread_key"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "oneOf": [
    {
      "not": {
        "required": [
          "error"
        ]
      },
      "properties": {
        "ok": {
          "const": true
        }
      },
      "required": [
        "data"
      ]
    },
    {
      "not": {
        "required": [
          "data"
        ]
      },
      "properties": {
        "ok": {
          "const": false
        }
      },
      "required": [
        "error"
      ]
    }
  ],
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "items": {
          "description": "Resources in this page.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "sender": {
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "anyOf": [
                      {
                        "format": "email",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "entity_id": {
                    "anyOf": [
                      {
                        "description": "Stable public identifier for the referenced resource.",
                        "maxLength": 255,
                        "minLength": 1,
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Stable public identifier for the referenced resource."
                  },
                  "entity_name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "entity_type": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "email",
                  "entity_type",
                  "entity_name",
                  "entity_id"
                ],
                "type": "object"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "created_at",
              "text",
              "sender"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "next_cursor": {
          "anyOf": [
            {
              "description": "Opaque cursor for the next page, or null when this is the final page.",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Opaque cursor for the next page, or null when this is the final page."
        }
      },
      "required": [
        "items",
        "next_cursor"
      ],
      "type": "object"
    },
    "error": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "details": {
          "additionalProperties": true,
          "description": "Optional bounded, agent-safe correction or recovery facts.",
          "type": "object"
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        }
      },
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "type": "object"
    },
    "meta": {
      "additionalProperties": false,
      "properties": {
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "request_id"
      ],
      "type": "object"
    },
    "ok": {
      "description": "Whether the tool completed successfully.",
      "type": "boolean"
    }
  },
  "required": [
    "ok",
    "meta"
  ],
  "type": "object"
}
```
