# Set a Deal's Project

`deals.set_project`

Group an existing Deal under a Project in this workspace. Supply project_id to use an existing Project, or name and optional request terms to create one. This preserves the application and its sharing. Each new request replaces the prior association; retry with the same UUID key to avoid repeating it. Read deals.get afterward. Copy project_id from projects.list.project_slug; do not combine an existing project_id with new-project fields.

[Deals guide](https://docs.levr.ai/mcp/resources/deals.md)

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

Operation: write. Required OAuth scopes: mcp.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "dependentRequired": {
    "target_amount": [
      "target_currency"
    ],
    "target_currency": [
      "target_amount"
    ]
  },
  "properties": {
    "deal_id": {
      "description": "Canonical deal_ identifier; copy the returned value unchanged.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "idempotency_key": {
      "format": "uuid",
      "type": "string"
    },
    "name": {
      "description": "Required to create a new Project when project_id is omitted.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "project_id": {
      "description": "Copy project_slug from projects.list. Omit name, purpose, target_amount and target_currency when supplied. Prefix: proj_.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "provider_slug": {
      "description": "Copy provider_slug from providers.list; named slugs are valid.",
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "purpose": {
      "maxLength": 10000,
      "type": "string"
    },
    "target_amount": {
      "pattern": "^[0-9]+(?:\\.[0-9]{1,2})?$",
      "type": "string"
    },
    "target_currency": {
      "pattern": "^[A-Za-z]{3}$",
      "type": "string"
    }
  },
  "required": [
    "provider_slug",
    "deal_id",
    "idempotency_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": {
        "deal_id": {
          "description": "Stable public identifier for the referenced resource.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        },
        "project_id": {
          "description": "Stable public identifier for the referenced resource.",
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "deal_id",
        "project_id"
      ],
      "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"
}
```

Check the result, then read the affected record to confirm your change.
