import { z } from "zod";
import type { ToolDefinition } from "../contracts.js";
import { toolInputSchema } from "../schema.js";

type EchoInput = string;

export function createEchoTool(): ToolDefinition<EchoInput> {
  return {
    description: "Echo input back to the caller without side effects.",
    effect: "read",
    executionClass: "read-only",
    idempotent: true,
    inputSchema: toolInputSchema(z.string()),
    name: "echo",
    source: "built-in",
    capabilities() {
      return [];
    },
    execute(input) {
      return input;
    },
  };
}
