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

Function resolveResourceContent

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

Source from the content-addressed store, hash-verified

1344}
1345
1346const resolveResourceContent = (
1347 uri: string,
1348 content: typeof ReadResourceResult.Type | string | Uint8Array
1349): typeof ReadResourceResult.Type => {
1350 if (typeof content === "string") {
1351 return {
1352 contents: [
1353 {
1354 uri,
1355 text: content
1356 }
1357 ]
1358 }
1359 } else if (content instanceof Uint8Array) {
1360 return {
1361 contents: [
1362 {
1363 uri,
1364 blob: content
1365 }
1366 ]
1367 }
1368 }
1369 return content
1370}

Callers 1

McpServer.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected