> ## Documentation Index
> Fetch the complete documentation index at: https://fastmcp-ts.docs.prefect.io/llms.txt
> Use this file to discover all available pages before exploring further.

# toResult

```ts theme={null}
function toResult<T, E>(fn): Promise<Result<T, E>>;
```

Defined in: [client/utils.ts:5](https://github.com/PrefectHQ/fastmcp-ts/blob/e4b6038f642b529f601463a576229747afebe9a4/src/client/utils.ts#L5)

## Type Parameters

### T

`T`

### E

`E` = `Error`

## Parameters

### fn

`Promise`\<`T`> | (() => `Promise`\<`T`>)

## Returns

`Promise`\<[`Result`](/api/client/type-aliases/Result)\<`T`, `E`>>
