# prescriptio_ao_document

Bibliotheque de reponse (CV, RSE, memoires gagnants, references, pieces administratives) et dossier d'un AO. action=library (inventaire, pour choisir quoi rattacher) ; list (documents deja rattaches) ; attach (rattacher un knowledge_doc_id) ; detach (retirer). draft_id requis sauf pour library.

État : implémenté ; distribution : historique uniquement ; offre payante : true ; effets : lecture et écriture possibles.

## Entrée MCP

```json
{
  "properties": {
    "action": {
      "description": "library (inventaire biblio), list (rattaches au dossier), attach, detach.",
      "enum": [
        "library",
        "list",
        "attach",
        "detach"
      ],
      "type": "string"
    },
    "draft_id": {
      "description": "UUID du dossier AO (requis sauf action:library).",
      "type": "string"
    },
    "knowledge_doc_id": {
      "description": "UUID d'un document de la bibliotheque (attach/detach), via action:library.",
      "type": "string"
    },
    "notes": {
      "description": "Note de rattachement (optionnel).",
      "maxLength": 1000,
      "type": "string"
    }
  },
  "required": [
    "action"
  ],
  "type": "object"
}
```

## Sortie MCP

```json
{
  "properties": {
    "action": {
      "type": "string"
    },
    "download_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "fields": {
      "type": "object"
    },
    "files": {
      "items": {
        "type": "object"
      },
      "type": "array"
    },
    "ok": {
      "type": "boolean"
    },
    "page": {
      "type": [
        "integer",
        "null"
      ]
    },
    "pages_total": {
      "type": [
        "integer",
        "null"
      ]
    },
    "quota": {
      "type": "object"
    },
    "texte": {
      "description": "Contenu textuel (pièce de DCE, PV…).",
      "type": "string"
    }
  },
  "type": "object"
}
```

[Contrats externes et limites](/docs/reference/concepts.md).
