# Document programs: render

URL: /code/mcp/document/verbs · Id: `page:code/mcp/document/verbs`

> The Document Verbs render as MCP do programs, with inputs, result, refusals and an example.

Reference for [Document](/business/nouns/document), one group of [Document programs](/code/mcp/document).

### Document.render
Render produces a file from a Document in the format the reader asks for. [Verb page](/business/nouns/document/render?interface=mcp).

```text
do: return await $.Document.render(input)
```

Emits [`Document.rendered`](/business/events/Document.rendered).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `document` | [Document](/business/nouns/document) | Yes | The Document to render. |
| `format` | `string` | Yes | The file format. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `file` | `url` | Yes | Where the file lives. |
| `document` | [Document](/business/nouns/document) | Yes | The Document rendered. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The input does not match the schema of the operation. | [`invalid-input`](/code/api/errors/invalid-input) | Read the schema of the operation, then send every required field with the right type. | None. |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Document.render({ document: 'document_af2wijcmRy', format: 'Example format' })"
  }
}
```