GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — SkillToolset | ADK for TypeScript: API Reference - v2.5.0

  • SkillToolset

Class SkillToolset

Base class for toolset.

A toolset is a collection of tools that can be used by an agent.

Hierarchy (View Summary)

  • BaseToolset
    • SkillToolset
  • Defined in core/src/tools/skill/skill_toolset.ts:45

Constructors

constructor

  • new SkillToolset(
        skills: Record<string, Skill> | Skill[],
        options?: {
            additionalTools?: (BaseTool | BaseToolset)[];
            allowInlineScripts?: boolean;
            codeExecutor?: BaseCodeExecutor;
            registry?: SkillRegistry;
            scriptOutputDir?: string;
        },
    ): SkillToolset

    Parameters

    • skills: Record<string, Skill> | Skill[]
    • options: {
          additionalTools?: (BaseTool | BaseToolset)[];
          allowInlineScripts?: boolean;
          codeExecutor?: BaseCodeExecutor;
          registry?: SkillRegistry;
          scriptOutputDir?: string;
      } = {}
      • OptionaladditionalTools?: (BaseTool | BaseToolset)[]
      • OptionalallowInlineScripts?: boolean

        Whether to expose the run_skill_inline_script tool, which executes model-provided script content in the configured code executor. This is disabled by default because arbitrary inline-script execution is a sensitive capability; opt in explicitly by setting this to true. Execution additionally remains gated behind a human-in-the-loop confirmation.

      • OptionalcodeExecutor?: BaseCodeExecutor
      • Optionalregistry?: SkillRegistry
      • OptionalscriptOutputDir?: string

        Directory that files produced by run_skill_script / run_skill_inline_script are written into. Output file names come from the executed script, so this must be a directory dedicated to throwaway script output — never the application's working directory or a source tree.

        Defaults to a private, randomly named directory created under the OS temp dir on first use. Nothing removes that directory: close() runs once per invocation on a toolset instance that concurrent invocations share (see Runner), so it cannot tell whose output is still in use. Set this to own the location and the lifetime of the output.

    Returns SkillToolset

    Overrides BaseToolset.constructor

    • Defined in core/src/tools/skill/skill_toolset.ts:56

Properties

Readonly[BASE_TOOLSET_SIGNATURE_SYMBOL]

"[BASE_TOOLSET_SIGNATURE_SYMBOL]": true

Inherited from BaseToolset.[BASE_TOOLSET_SIGNATURE_SYMBOL]

  • Defined in core/src/tools/base_toolset.ts:42

additionalTools

additionalTools: (BaseTool | BaseToolset)[]
  • Defined in core/src/tools/skill/skill_toolset.ts:48

OptionalcodeExecutor

codeExecutor?: BaseCodeExecutor
  • Defined in core/src/tools/skill/skill_toolset.ts:49

Optional Readonlyprefix

prefix?: string

Inherited from BaseToolset.prefix

  • Defined in core/src/tools/base_toolset.ts:46

Optionalregistry

registry?: SkillRegistry
  • Defined in core/src/tools/skill/skill_toolset.ts:50

skills

skills: Record<string, Skill>
  • Defined in core/src/tools/skill/skill_toolset.ts:46

ReadonlytoolFilter

toolFilter:
    | string[]
    | ((tool: BaseTool, readonlyContext?: ReadonlyContext) => boolean) = []

Inherited from BaseToolset.toolFilter

  • Defined in core/src/tools/base_toolset.ts:45

Methods

close

  • close(): Promise<void>

    Closes the toolset.

    NOTE: This method is invoked, for example, at the end of an agent server's lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.

    Returns Promise<void>

    A Promise that resolves when the toolset is closed.

    Overrides BaseToolset.close

    • Defined in core/src/tools/skill/skill_toolset.ts:119

getOrFetchSkill

  • getOrFetchSkill(name: string, invocationId?: string): Promise<Skill | undefined>

    Parameters

    • name: string
    • OptionalinvocationId: string

    Returns Promise<Skill | undefined>

    • Defined in core/src/tools/skill/skill_toolset.ts:153

getScriptOutputDir

  • getScriptOutputDir(): Promise<string>

    Resolves the directory that script output files are materialized into.

    Script output file names are attacker-influenced (a prompt-injected skill controls what its script writes), so they must never be resolved against the host application's working directory. When no scriptOutputDir was configured this hands back a private temp directory instead, created once and reused for the lifetime of the toolset.

    Returns Promise<string>

    • Defined in core/src/tools/skill/skill_toolset.ts:137

getSkill

  • getSkill(name: string): Skill | undefined

    Parameters

    • name: string

    Returns Skill | undefined

    • Defined in core/src/tools/skill/skill_toolset.ts:124

getTools

  • getTools(context?: ReadonlyContext): Promise<BaseTool[]>

    Returns the tools that should be exposed to LLM.

    Parameters

    • Optionalcontext: ReadonlyContext

      Context used to filter tools available to the agent. If not defined, all tools in the toolset are returned.

    Returns Promise<BaseTool[]>

    A Promise that resolves to the list of tools.

    Overrides BaseToolset.getTools

    • Defined in core/src/tools/skill/skill_toolset.ts:114

ProtectedisToolSelected

  • isToolSelected(tool: BaseTool, context?: ReadonlyContext): boolean

    Returns whether the tool should be exposed to LLM.

    Parameters

    • tool: BaseTool

      The tool to check.

    • Optionalcontext: ReadonlyContext

      Context used to filter tools available to the agent.

    Returns boolean

    Whether the tool should be exposed to LLM.

    Inherited from BaseToolset.isToolSelected

    • Defined in core/src/tools/base_toolset.ts:77

processLlmRequest

  • processLlmRequest(toolContext: Context, llmRequest: LlmRequest): Promise<void>

    Processes the outgoing LLM request for this toolset. This method will be called before each tool processes the llm request.

    Use cases:

    • Instead of let each tool process the llm request, we can let the toolset process the llm request. e.g. ComputerUseToolset can add computer use tool to the llm request.

    Parameters

    • toolContext: Context
    • llmRequest: LlmRequest

    Returns Promise<void>

    Overrides BaseToolset.processLlmRequest

    • Defined in core/src/tools/skill/skill_toolset.ts:184
Constructors
constructor
Properties
[BASE_TOOLSET_SIGNATURE_SYMBOL]additionalToolscodeExecutorprefixregistryskillstoolFilter
Methods
closegetOrFetchSkillgetScriptOutputDirgetSkillgetToolsisToolSelectedprocessLlmRequest
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.