Skip to content

@maxhealth.tech/prefab / mcp / McpResourceReadResult

Type Alias: McpResourceReadResult<C>

ts
type McpResourceReadResult<C> = object;

Defined in: mcp/types.ts:156

A resources/read result carrying the required cache fields.

Generic over the contents kind so a handler that only ever returns text (the prefab viewer, for one) does not force callers to narrow the union.

A type alias rather than an interface, so it satisfies the SDK's passthrough ReadResourceResult ({ [x: string]: unknown }) without a cast. See McpTextResourceContents for why the distinction matters — returning this straight from an SDK read handler is the whole point of the type, and as an interface it did not typecheck there.

Type Parameters

Type ParameterDefault type
C extends | McpTextResourceContents | McpBlobResourceContents| McpTextResourceContents | McpBlobResourceContents

Properties

contents

ts
contents: C[];

Defined in: mcp/types.ts:159


ttlMs

ts
ttlMs: number;

Defined in: mcp/types.ts:161

Cache lifetime in milliseconds.


cacheScope

ts
cacheScope: McpCacheScope;

Defined in: mcp/types.ts:163

Whether shared caches may store the result.

Released under the MIT License.