# Media tools

> MCP tools for Media: media_get, media_public_get.

- `media_get`: Get an image
- `media_public_get`: Get a brand's public image

## `media_get`

**Get an image.** Operation [`media.get`](https://ownrecord.io/docs/reference/media-get.md) · Platform level · permission `account:read` · risk tier `read` · since M13

Returns an uploaded image's type, size, SHA-256 and path: an organization's or legal entity's image, a brand's
logo or icon, or a person's photo. The console loads images from their path (`/media/{fileId}/{sha256}.{ext}`),
which runs this check first.

**Who can see what:** organization, entity and brand images, the organization's members (any role); a person's
photo, the person and the members of organizations they belong to; Ownrecord staff, every image. Anything else
is `resource_not_found`, exactly like an image that doesn't exist. Brand logos and icons are also public once the
brand is in test or live mode (`media.public.get`). API keys can't call it.

Annotations: `readOnlyHint: true` · `destructiveHint: false` · `idempotentHint: true` · `openWorldHint: false`

### Arguments

| Argument | Type          | Required | Description                                              |
| -------- | ------------- | -------- | -------------------------------------------------------- |
| `fileId` | ID (`file_…`) | yes      | The image's file ID (`file_…`), as in its `/media` path. |

- **Read-only:** changes nothing; `idempotency_key` is ignored.

### Errors

- [`validation_failed`](https://ownrecord.io/docs/reference/errors.md#validation_failed): `fileId` isn't a file ID.
- [`resource_not_found`](https://ownrecord.io/docs/reference/errors.md#resource_not_found): There is no such image, or you may not see it (the answer is the same).
- [`permission_denied`](https://ownrecord.io/docs/reference/errors.md#permission_denied): The caller isn't a signed-in user (for example, an API key).

### Example

**The organization's image**

Arguments:

```json
{
  "fileId": "file_01m4tx5nj8emwbyf7y9vcf47yc"
}
```

Result `output`:

```json
{
  "id": "file_01m4tx5nj8emwbyf7y9vcf47yc",
  "object": "media",
  "kind": "org_avatar",
  "contentType": "image/png",
  "size": 68,
  "sha256": "63ef318d96b5d0d0ceba6e04a4e622b1158335cdc67c49e27839132c6f655058",
  "url": "/media/file_01m4tx5nj8emwbyf7y9vcf47yc/63ef318d96b5d0d0ceba6e04a4e622b1158335cdc67c49e27839132c6f655058.png",
  "visibility": "private"
}
```

## `media_public_get`

**Get a brand's public image.** Operation [`media.public.get`](https://ownrecord.io/docs/reference/media-public-get.md) · Brand level · permission `brands:read` · risk tier `read` · since M13

Returns a brand's uploaded logo or icon (type, size, SHA-256 and path) without authentication: customers see
them on checkout, the portal and in emails. Only brand images of brands in test or live mode are public; any
other file ID is `resource_not_found`.

Annotations: `readOnlyHint: true` · `destructiveHint: false` · `idempotentHint: true` · `openWorldHint: false`

### Arguments

| Argument    | Type          | Required | Description                                                                                                                              |
| ----------- | ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `fileId`    | ID (`file_…`) | yes      | The image's file ID (`file_…`), as in its `/media` path.                                                                                 |
| `entity_id` | ID (`ent_…`)  | no       | Optional: the brand's legal entity (ent\_…); `brand_id` alone is enough.                                                                 |
| `brand_id`  | ID (`brd_…`)  | no       | The brand to act on (brd\_…), inside your API key's reach. Needed with an organization or entity key; a brand key acts on its own brand. |

- **Brand:** pass `brand_id` with an organization or entity key; a brand key acts on its own brand.
- **Read-only:** changes nothing; `idempotency_key` is ignored.

### Errors

- [`validation_failed`](https://ownrecord.io/docs/reference/errors.md#validation_failed): `fileId` isn't a file ID.
- [`resource_not_found`](https://ownrecord.io/docs/reference/errors.md#resource_not_found): There is no such brand image, or its brand isn't in test or live mode.

### Example

**A brand's icon**

Arguments:

```json
{
  "fileId": "file_01m4tx5nj8emwbyf7y9vcf47yc",
  "brand_id": "brd_01jbx4m3v8e9t0s6k2c5n7q1wz"
}
```

Result `output`:

```json
{
  "id": "file_01m4tx5nj8emwbyf7y9vcf47yc",
  "object": "media",
  "kind": "brand_icon",
  "contentType": "image/png",
  "size": 68,
  "sha256": "63ef318d96b5d0d0ceba6e04a4e622b1158335cdc67c49e27839132c6f655058",
  "url": "/media/file_01m4tx5nj8emwbyf7y9vcf47yc/63ef318d96b5d0d0ceba6e04a4e622b1158335cdc67c49e27839132c6f655058.png",
  "visibility": "public"
}
```
