MCPcopy Create free account
hub / github.com/codeaashu/claude-code / renderToolUseMessage

Function renderToolUseMessage

src/tools/MCPTool/UI.tsx:41–56  ·  view source on GitHub ↗
(input: z.infer<ReturnType<typeof inputSchema>>, {
  verbose
}: {
  verbose: boolean;
})

Source from the content-addressed store, hash-verified

39// long enough that inline display would be worse than unwrapping.
40const UNWRAP_MIN_STRING_LEN = 200;
41export function renderToolUseMessage(input: z.infer<ReturnType<typeof inputSchema>>, {
42 verbose
43}: {
44 verbose: boolean;
45}): React.ReactNode {
46 if (Object.keys(input).length === 0) {
47 return '';
48 }
49 return Object.entries(input).map(([key, value]) => {
50 let rendered = jsonStringify(value);
51 if (feature('MCP_RICH_OUTPUT') && !verbose && rendered.length > MAX_INPUT_VALUE_CHARS) {
52 rendered = rendered.slice(0, MAX_INPUT_VALUE_CHARS).trimEnd() + '…';
53 }
54 return `${key}: ${rendered}`;
55 }).join(', ');
56}
57export function renderToolUseProgressMessage(progressMessagesForMessage: ProgressMessage<MCPProgress>[]): React.ReactNode {
58 const lastProgress = progressMessagesForMessage.at(-1);
59 if (!lastProgress?.data) {

Callers

nothing calls this directly

Calls 4

jsonStringifyFunction · 0.85
featureFunction · 0.85
keysMethod · 0.80
entriesMethod · 0.80

Tested by

no test coverage detected