> ## Documentation Index
> Fetch the complete documentation index at: https://colin-feat-client-cache-mode.mintlify.site/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/8976c37f79efa6b87809b884f29a1f235a8c4ad1/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`>>
