Interface: ToolWithDependencies
@providerprotocol/agents / index / ToolWithDependencies
Interface: ToolWithDependencies
Section titled “Interface: 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
Example
Section titled “Example”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),};Extends
Section titled “Extends”Properties
Section titled “Properties”dependsOn?
Section titled “dependsOn?”
optionaldependsOn:string[]
Defined in: src/execution/types.ts:485
Tool names that must complete before this tool can execute. Used for explicit dependency chains.
Inherited from
Section titled “Inherited from”ToolDependencyOptions.dependsOn
description
Section titled “description”description:
string
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:168
Human-readable description for the model
Inherited from
Section titled “Inherited from”Tool.description
name:
string
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:166
Tool name (must be unique within a llm() instance)
Inherited from
Section titled “Inherited from”Tool.name
parameters
Section titled “parameters”parameters:
JSONSchema
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:170
JSON Schema defining parameters
Inherited from
Section titled “Inherited from”Tool.parameters
sequential?
Section titled “sequential?”
optionalsequential: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.
Inherited from
Section titled “Inherited from”ToolDependencyOptions.sequential
Methods
Section titled “Methods”approval()?
Section titled “approval()?”
optionalapproval(params):boolean|Promise<boolean>
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:174
Optional approval handler for sensitive operations
Parameters
Section titled “Parameters”params
Section titled “params”unknown
Returns
Section titled “Returns”boolean | Promise<boolean>
Inherited from
Section titled “Inherited from”Tool.approval
run(
params):unknown
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:172
Tool execution function
Parameters
Section titled “Parameters”params
Section titled “params”unknown
Returns
Section titled “Returns”unknown
Inherited from
Section titled “Inherited from”Tool.run