Skip to content

Interface: ToolWithDependencies

@providerprotocol/agents


@providerprotocol/agents / index / ToolWithDependencies

Defined in: src/execution/types.ts:526

Extended Tool interface with UAP dependency options.

Use this type when defining tools that need execution ordering. Combines the standard UPP Tool interface with ToolDependencyOptions.

UAP-1.0 Spec Section 8.5

const readTool: ToolWithDependencies = {
name: 'read_file',
description: 'Read a file',
parameters: {
type: 'object',
properties: { path: { type: 'string' } },
required: ['path'],
},
sequential: true, // Must complete before other tools
run: async (params) => fs.readFile(params.path, 'utf-8'),
};
const writeTool: ToolWithDependencies = {
name: 'write_file',
description: 'Write a file',
parameters: {
type: 'object',
properties: {
path: { type: 'string' },
content: { type: 'string' },
},
required: ['path', 'content'],
},
dependsOn: ['read_file'], // Waits for read_file to complete
run: async (params) => fs.writeFile(params.path, params.content),
};

optional dependsOn: string[]

Defined in: src/execution/types.ts:485

Tool names that must complete before this tool can execute. Used for explicit dependency chains.

ToolDependencyOptions.dependsOn


description: string

Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:168

Human-readable description for the model

Tool.description


name: string

Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:166

Tool name (must be unique within a llm() instance)

Tool.name


parameters: JSONSchema

Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:170

JSON Schema defining parameters

Tool.parameters


optional sequential: boolean

Defined in: src/execution/types.ts:479

If true, this tool must complete before other tools start. Sequential tools create a barrier in parallel execution.

ToolDependencyOptions.sequential

optional approval(params): boolean | Promise<boolean>

Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:174

Optional approval handler for sensitive operations

unknown

boolean | Promise<boolean>

Tool.approval


run(params): unknown

Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:172

Tool execution function

unknown

unknown

Tool.run