MCPcopy Create free account
hub / github.com/Effect-TS/effect / resolveResourceContent

Function resolveResourceContent

packages/effect/src/unstable/ai/McpServer.ts:2271–2291  ·  view source on GitHub ↗
(
  uri: string,
  content: typeof ReadResourceResult.Type | string | Uint8Array
)

Source from the content-addressed store, hash-verified

2269 )
2270
2271const resolveResourceContent = (
2272 uri: string,
2273 content: typeof ReadResourceResult.Type | string | Uint8Array
2274): typeof ReadResourceResult.Type => {
2275 if (typeof content === "string") {
2276 return {
2277 contents: [{
2278 uri,
2279 text: content
2280 }]
2281 }
2282 } else if (content instanceof Uint8Array) {
2283 return {
2284 contents: [{
2285 uri,
2286 blob: content
2287 }]
2288 }
2289 }
2290 return content
2291}
2292
2293const getClientSession = (
2294 sessions: Sessions,

Callers 1

McpServer.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected