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

Function $getToolCallString

common/src/tools/params/utils.ts:92–107  ·  view source on GitHub ↗
(params: {
  toolName: string
  inputSchema: z.ZodType<any, Input> | null
  input: Input
  endsAgentStep: boolean
})

Source from the content-addressed store, hash-verified

90 * @param endsAgentStep - Whether the agent should end its turn after this tool call
91 */
92export function $getToolCallString<Input>(params: {
93 toolName: string
94 inputSchema: z.ZodType<any, Input> | null
95 input: Input
96 endsAgentStep: boolean
97}): string {
98 const { toolName, input, endsAgentStep } = params
99 const obj: Record<string, any> = {
100 [toolNameParam]: toolName,
101 ...input,
102 }
103 if (endsAgentStep) {
104 obj[endsAgentStepParam] = endsAgentStep satisfies true
105 }
106 return [startToolTag, JSON.stringify(obj, null, 2), endToolTag].join('')
107}
108
109export function $getNativeToolCallExampleString<Input>(params: {
110 toolName: string

Callers 1

getToolCallStringFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected