Agent Tool Types and Schemas (guest-js/types.ts)

jan · src-tauri/plugins/tauri-plugin-agent-tools/guest-js/types.ts · typescript · Apache-2.0
ai, database, lang:typescript, tag:tools

Defines TypeScript interfaces for AI agent tools, including skill metadata, execution results, and OpenAI-compatible function schemas. Reuse when building AI tool-calling plugins.

// Source: https://github.com/janhq/jan | License: Apache-2.0 | Copyright 2025 Menlo Research
// Provided via justclaw.it.com; keep this notice with the code.
/** A skill's summary as returned by `skillList`. */
export interface SkillMeta {
  name: string
  description: string
  user_invocable?: boolean
  model_invocable?: boolean
}

/** An image a tool returned, as a `data:` URL plus its display name. */
export interface ToolImage {
  dataUrl: string
  name: string
}

/** Outcome of a built-in tool execution. */
export interface ToolResult {
  content: string
  /** Display-only diff for write/edit; never part of model context. */
  diff: string | null
  isError: boolean
  /** Present when the tool returned images (`read` of an image, `screenshot`). */
  images?: ToolImage[]
}

/**
 * An O

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key