MCPcopy
hub / github.com/RedPlanetHQ/core / executeExecTool

Function executeExecTool

packages/cli/src/server/tools/exec-tools.ts:555–576  ·  view source on GitHub ↗
(
	toolName: string,
	params: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

553// ============ Tool Execution ============
554
555export async function executeExecTool(
556 toolName: string,
557 params: Record<string, unknown>,
558): Promise<{success: boolean; result?: unknown; error?: string}> {
559 try {
560 switch (toolName) {
561 case 'exec_command':
562 return await handleExecCommand(ExecCommandSchema.parse(params));
563
564 default:
565 return {success: false, error: `Unknown tool: ${toolName}`};
566 }
567 } catch (err) {
568 if (err instanceof zod.ZodError) {
569 return {success: false, error: `Invalid parameters: ${err.message}`};
570 }
571 return {
572 success: false,
573 error: err instanceof Error ? err.message : 'Unknown error',
574 };
575 }
576}

Callers

nothing calls this directly

Calls 2

handleExecCommandFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected