MCPcopy
hub / github.com/CodebuffAI/codebuff / getToolCallString

Function getToolCallString

common/src/tools/utils.ts:7–24  ·  view source on GitHub ↗
(
  toolName: T,
  input: T extends ToolName
    ? z.input<(typeof toolParams)[T]['inputSchema']>
    : Record<string, any>,
  ...endsAgentStep: T extends ToolName ? [] : [boolean]
)

Source from the content-addressed store, hash-verified

5import type z from 'zod/v4'
6
7export function getToolCallString<T extends ToolName | (string & {})>(
8 toolName: T,
9 input: T extends ToolName
10 ? z.input<(typeof toolParams)[T]['inputSchema']>
11 : Record<string, any>,
12 ...endsAgentStep: T extends ToolName ? [] : [boolean]
13): string {
14 const endsAgentStepValue =
15 toolName in toolParams
16 ? toolParams[toolName as keyof typeof toolParams].endsAgentStep
17 : endsAgentStep[0] ?? false
18 return $getToolCallString({
19 toolName,
20 inputSchema: null,
21 input,
22 endsAgentStep: endsAgentStepValue,
23 })
24}

Callers 6

buildToolDescriptionFunction · 0.90
getToolsInstructionsFunction · 0.90
getShortToolInstructionsFunction · 0.90
ask.tsFile · 0.90
baseAgentSystemPromptFunction · 0.90
baseAgentUserInputPromptFunction · 0.90

Calls 1

$getToolCallStringFunction · 0.90

Tested by

no test coverage detected