mcp-ai-agent-guidelines
Version:
A comprehensive Model Context Protocol server providing advanced tools, resources, and prompts for implementing AI agent best practices
81 lines • 2.63 kB
TypeScript
/**
* Agent Orchestrator Tool - Refactored Version
*
* MCP tool for agent-to-agent (A2A) orchestration using the new infrastructure.
* Provides actions for agent handoffs, workflow execution, and discovery.
*
* Features:
* - List available agents and workflows
* - Execute agent handoffs with context passing
* - Execute multi-step workflows
* - Error handling with typed error codes
*/
import { z } from "zod";
/**
* Zod schema for agent orchestrator action types
*/
declare const AgentOrchestratorActionSchema: z.ZodEnum<["handoff", "workflow", "list-agents", "list-workflows"]>;
/**
* Zod schema for agent orchestrator request
* Uses discriminated union based on action type for proper validation
*/
declare const AgentOrchestratorSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
action: z.ZodLiteral<"list-agents">;
}, "strip", z.ZodTypeAny, {
action: "list-agents";
}, {
action: "list-agents";
}>, z.ZodObject<{
action: z.ZodLiteral<"list-workflows">;
}, "strip", z.ZodTypeAny, {
action: "list-workflows";
}, {
action: "list-workflows";
}>, z.ZodObject<{
action: z.ZodLiteral<"handoff">;
targetAgent: z.ZodString;
context: z.ZodOptional<z.ZodUnknown>;
reason: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
action: "handoff";
targetAgent: string;
context?: unknown;
reason?: string | undefined;
}, {
action: "handoff";
targetAgent: string;
context?: unknown;
reason?: string | undefined;
}>, z.ZodObject<{
action: z.ZodLiteral<"workflow">;
workflowName: z.ZodString;
workflowInput: z.ZodOptional<z.ZodUnknown>;
}, "strip", z.ZodTypeAny, {
action: "workflow";
workflowName: string;
workflowInput?: unknown;
}, {
action: "workflow";
workflowName: string;
workflowInput?: unknown;
}>]>;
/**
* Supported actions for the agent orchestrator tool
*/
export type AgentOrchestratorAction = z.infer<typeof AgentOrchestratorActionSchema>;
/**
* Request schema for the agent orchestrator tool
*/
export type AgentOrchestratorRequest = z.infer<typeof AgentOrchestratorSchema>;
/**
* Agent Orchestrator Tool
*
* Coordinates agent handoffs and workflow execution using the orchestration infrastructure.
*
* @param args - The orchestrator request with action and parameters (validated against schema)
* @returns MCP-formatted response
* @throws {McpToolError} If validation fails or action is invalid
*/
export declare function agentOrchestratorTool(args: unknown): Promise<import("./shared/error-handler.js").McpResponse>;
export {};
//# sourceMappingURL=agent-orchestrator.d.ts.map