---
url: >-
  https://adk.nht.io/api/@nhtio/adk/types/type-aliases/DispatchMediaBytesStoreFn.md
description: >-
  Persists tool-generated media bytes into consumer storage and returns a {@link
  @nhtio/adk!MediaReader} (LLM execution context variant). Unlike the `store*`
  mutation callbacks this returns a value and does NOT add anything to the turn
  Sets — the handler builds a {@link @nhtio/adk!Media} from the reader and
  persists it via `storeMessage`/`storeToolCall` separately.
---

# Type Alias: DispatchMediaBytesStoreFn

```ts
type DispatchMediaBytesStoreFn = (
  ctx: DispatchContext,
  id: string,
  bytes: ConduitBytes,
) => MediaReader | Promise<MediaReader>;
```

Defined in: [lib/contracts/dispatch\_context.ts:140](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/dispatch_context.ts#L140)

Persists tool-generated media bytes into consumer storage and returns a [@nhtio/adk!MediaReader](../../common/interfaces/MediaReader.md)
(LLM execution context variant). Unlike the `store*` mutation callbacks this returns a value and
does NOT add anything to the turn Sets — the handler builds a [@nhtio/adk!Media](../../common/classes/Media.md) from the reader
and persists it via `storeMessage`/`storeToolCall` separately.

## Parameters

| Parameter | Type                                                  |
| --------- | ----------------------------------------------------- |
| `ctx`     | [`DispatchContext`](../interfaces/DispatchContext.md) |
| `id`      | `string`                                              |
| `bytes`   | [`ConduitBytes`](ConduitBytes.md)                     |

## Returns

| [`MediaReader`](../../common/interfaces/MediaReader.md)
| `Promise`<[`MediaReader`](../../common/interfaces/MediaReader.md)>
