import { z } from '@frontmcp/lazy-zod';
import { Tool, ToolContext } from '@frontmcp/sdk';

const inputSchema = {
  name: z.string().default('World'),
};

const outputSchema = z.object({
  message: z.string(),
  scope: z.literal('parent'),
});

type Input = z.output<z.ZodObject<typeof inputSchema>>;
type Output = z.output<typeof outputSchema>;

@Tool({
  name: 'parent-hello',
  description: 'A simple hello tool in the parent/root scope',
  inputSchema,
  outputSchema,
})
export default class ParentHelloTool extends ToolContext {
  async execute(input: Input): Promise<Output> {
    const { name } = input;
    return {
      message: `Hello, ${name}! This is from the parent/root scope.`,
      scope: 'parent',
    };
  }
}
