MCPcopy Index your code
hub / github.com/TanStack/ai / resolveToolName

Function resolveToolName

packages/ai-opencode/src/stream/translate.ts:42–52  ·  view source on GitHub ↗
(
  tool: string,
  bridgedToolNames: ReadonlySet<string> | undefined,
)

Source from the content-addressed store, hash-verified

40 * foreign MCP tools) uses the harness tool name verbatim.
41 */
42export function resolveToolName(
43 tool: string,
44 bridgedToolNames: ReadonlySet<string> | undefined,
45): string {
46 if (!bridgedToolNames || bridgedToolNames.size === 0) return tool
47 if (bridgedToolNames.has(tool)) return tool
48 if (tool.startsWith('tanstack_') && bridgedToolNames.has(tool.slice(9))) {
49 return tool.slice(9)
50 }
51 return tool
52}
53
54function buildUsage(
55 tokens: OpencodeTokens | undefined,

Callers 2

translate.test.tsFile · 0.90
openToolCallFunction · 0.70

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected