---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/helpers/variables/defaultRenderTransformersJsToolResult.md
description: 'Default [`renderTransformersJsToolResult`](https://adk.nht.io/api/@nhtio/adk/batteries/llm/transformers_js/helpers/functions/renderTransformersJsToolResult).'
---

# Variable: defaultRenderTransformersJsToolResult

```ts
const defaultRenderTransformersJsToolResult: (input: {
  renderArtifactHandleBody?: (input: {
    artifact: unknown;
    byteLength: number;
    callId: string;
    encoding?: string;
    estimatedTokens?: number;
    lineCount: number;
  }) => string;
  renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string;
  renderUntrustedContent: (
    content: string,
    attrs: UntrustedContentAttrs,
  ) => string;
  results: Tokenizable | SpooledArtifact | Media | Media[] | SpooledArtifact[];
  tool: Tool<SpooledArtifact> | ArtifactTool | undefined;
  toolCall: ToolCall;
  unsupportedMediaPolicy: UnsupportedMediaPolicy;
  warn?: (msg: string) => void;
}) => Promise<string> = renderTransformersJsToolResult;
```

Defined in: [src/batteries/llm/transformers\_js/helpers.ts:275](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/transformers_js/helpers.ts#L275)

Default [renderTransformersJsToolResult](../functions/renderTransformersJsToolResult.md).

Render a [@nhtio/adk!ToolCall](../../../../../forge/classes/ToolCall.md)'s `results` into a plain-text tool message body.

## Parameters

| Parameter                         | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                           | { `renderArtifactHandleBody?`: (`input`: { `artifact`: `unknown`; `byteLength`: `number`; `callId`: `string`; `encoding?`: `string`; `estimatedTokens?`: `number`; `lineCount`: `number`; }) => `string`; `renderTrustedContent`: (`content`: `string`, `attrs`: [`TrustedContentAttrs`](../../../../interfaces/TrustedContentAttrs.md)) => `string`; `renderUntrustedContent`: (`content`: `string`, `attrs`: [`UntrustedContentAttrs`](../../../../interfaces/UntrustedContentAttrs.md)) => `string`; `results`: | [`Tokenizable`](../../../../../common/classes/Tokenizable.md) | [`SpooledArtifact`](../../../../../spooled_artifact/classes/SpooledArtifact.md) | [`Media`](../../../../../common/classes/Media.md) | [`Media`](../../../../../common/classes/Media.md)\[] | [`SpooledArtifact`](../../../../../spooled_artifact/classes/SpooledArtifact.md)\[]; `tool`: | [`Tool`](../../../../../forge/classes/Tool.md)<[`SpooledArtifact`](../../../../../spooled_artifact/classes/SpooledArtifact.md)> | [`ArtifactTool`](../../../../../forge/classes/ArtifactTool.md) | `undefined`; `toolCall`: [`ToolCall`](../../../../../forge/classes/ToolCall.md); `unsupportedMediaPolicy`: [`UnsupportedMediaPolicy`](../../type-aliases/UnsupportedMediaPolicy.md); `warn?`: (`msg`: `string`) => `void`; } | -                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.renderArtifactHandleBody?` | (`input`: { `artifact`: `unknown`; `byteLength`: `number`; `callId`: `string`; `encoding?`: `string`; `estimatedTokens?`: `number`; `lineCount`: `number`; }) => `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Override for the artifact-handle body renderer (see [renderArtifactHandleBody](../functions/renderArtifactHandleBody.md)). Defaults to the shared [defaultRenderArtifactHandleBody](defaultRenderArtifactHandleBody.md). The adapter threads the consumer's `helpers.renderArtifactHandleBody` here so an app can change which forged `artifact_*` reader the model is steered toward first. |
| `input.renderTrustedContent`      | (`content`: `string`, `attrs`: [`TrustedContentAttrs`](../../../../interfaces/TrustedContentAttrs.md)) => `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | -                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.renderUntrustedContent`    | (`content`: `string`, `attrs`: [`UntrustedContentAttrs`](../../../../interfaces/UntrustedContentAttrs.md)) => `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | -                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.results`                   | | [`Tokenizable`](../../../../../common/classes/Tokenizable.md) | [`SpooledArtifact`](../../../../../spooled_artifact/classes/SpooledArtifact.md) | [`Media`](../../../../../common/classes/Media.md) | [`Media`](../../../../../common/classes/Media.md)\[] | [`SpooledArtifact`](../../../../../spooled_artifact/classes/SpooledArtifact.md)\[]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | -                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.tool`                      | | [`Tool`](../../../../../forge/classes/Tool.md)<[`SpooledArtifact`](../../../../../spooled_artifact/classes/SpooledArtifact.md)> | [`ArtifactTool`](../../../../../forge/classes/ArtifactTool.md) | `undefined`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | -                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.toolCall`                  | [`ToolCall`](../../../../../forge/classes/ToolCall.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | -                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.unsupportedMediaPolicy`    | [`UnsupportedMediaPolicy`](../../type-aliases/UnsupportedMediaPolicy.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | -                                                                                                                                                                                                                                                                                                                                                                                            |
| `input.warn?`                     | (`msg`: `string`) => `void`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | -                                                                                                                                                                                                                                                                                                                                                                                            |

## Returns

`Promise`<`string`>

## Remarks

transformers.js chat templates take a `tool`-role message whose `content` is a string. A
`SpooledArtifact` result renders as a HANDLE (metadata + the forged `artifact_*` tools to read it)
when its `ToolCall.inline === false` — the secure default — and inline via `asString()` only when a
producer opted into `inline: true`. Applies the trust envelope and degrades Media to text.
