Skip to content
Français

HarnessTool

import type { HarnessTool } from "@elie-laloum/outpost";
  • kindRequired
    "tool"
    Definition discriminator: tool.
  • nameRequired
    string
    Unique tool name shown to the model.
  • descriptionRequired
    string
    Explanation sent to the model with the tool.
  • readOnlyRequired
    boolean
    Whether the tool may run concurrently with other read-only calls.
  • inputSchemaRequired
    Readonly<Record<string, unknown>>
    Frozen JSON Schema sent to the model, converted from a Standard Schema when needed.
  • validateRequired
    (value: unknown) => Promise<ToolValidation<Input>>
    Check raw model arguments and return the typed value or a readable issue list.
  • resourcesRequired
    (input: Input) => ToolResources
    Paths and command of a validated input; empty when the tool declares none.
  • executeRequired
    (input: Input, context: HarnessToolContext) => ToolOutput | Promise<ToolOutput>
    Run the call with validated input and its context.
export interface HarnessTool<Input = unknown> {
  readonly kind: "tool";
  readonly name: string;
  readonly description: string;
  readonly readOnly: boolean;
  readonly inputSchema: JsonSchema;
  validate(value: unknown): Promise<ToolValidation<Input>>;
  resources(input: Input): ToolResources;
  execute(
    input: Input,
    context: HarnessToolContext,
  ): ToolOutput | Promise<ToolOutput>;
}