dataflow.api.routes.tools_routes¶

Tools API routes for discovering and listing available tools.

This module provides FastAPI routes for discovering and listing all available tools in the Haive ecosystem. It scans the haive-tools package and returns information about available tools and toolkits.

Classes¶

ToolInfo

Information about a tool.

ToolInvokeRequest

Request to invoke a tool.

ToolInvokeResponse

Response from tool invocation.

ToolSchema

Tool input/output schema information.

ToolsListResponse

Response for tools list endpoint.

Functions¶

discover_tools()

Discover all available tools from haive-tools package.

get_tool_details(tool_name)

Get detailed information about a specific tool.

get_tool_schema(tool_module_path)

Extract input schema from a tool module.

get_tool_schema_endpoint(tool_name)

Get the input/output schema for a specific tool.

get_tool_schema_for_name(tool_module_path, ...)

Extract input schema for a specific tool by name.

invoke_tool(tool_module_path, arguments)

Invoke a tool with given arguments.

invoke_tool_endpoint(request)

Invoke a tool with the provided arguments.

list_tools()

List all available tools.

search_tools([query, category, tool_type])

Search for tools by query, category, or type.

simple_discover_tools()

Simple tool discovery that always works.

Module Contents¶

class dataflow.api.routes.tools_routes.ToolInfo(/, **data)¶

Bases: pydantic.BaseModel

Information about a tool.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class dataflow.api.routes.tools_routes.ToolInvokeRequest(/, **data)¶

Bases: pydantic.BaseModel

Request to invoke a tool.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class dataflow.api.routes.tools_routes.ToolInvokeResponse(/, **data)¶

Bases: pydantic.BaseModel

Response from tool invocation.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class dataflow.api.routes.tools_routes.ToolSchema(/, **data)¶

Bases: pydantic.BaseModel

Tool input/output schema information.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class dataflow.api.routes.tools_routes.ToolsListResponse(/, **data)¶

Bases: pydantic.BaseModel

Response for tools list endpoint.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

dataflow.api.routes.tools_routes.discover_tools()¶

Discover all available tools from haive-tools package.

Return type:

list[ToolInfo]

async dataflow.api.routes.tools_routes.get_tool_details(tool_name)¶

Get detailed information about a specific tool.

Parameters:

tool_name (str) – Name of the tool to get details for

Returns:

Detailed information about the tool

Return type:

dict[str, Any]

dataflow.api.routes.tools_routes.get_tool_schema(tool_module_path)¶

Extract input schema from a tool module.

Parameters:

tool_module_path (str)

Return type:

dict[str, Any]

async dataflow.api.routes.tools_routes.get_tool_schema_endpoint(tool_name)¶

Get the input/output schema for a specific tool.

Parameters:

tool_name (str) – Name of the tool to get schema for

Returns:

ToolSchema containing input and output schemas

Return type:

ToolSchema

dataflow.api.routes.tools_routes.get_tool_schema_for_name(tool_module_path, target_tool_name)¶

Extract input schema for a specific tool by name.

Parameters:
  • tool_module_path (str)

  • target_tool_name (str)

Return type:

dict[str, Any]

async dataflow.api.routes.tools_routes.invoke_tool(tool_module_path, arguments)¶

Invoke a tool with given arguments.

Parameters:
  • tool_module_path (str)

  • arguments (dict[str, Any])

Return type:

Any

async dataflow.api.routes.tools_routes.invoke_tool_endpoint(request)¶

Invoke a tool with the provided arguments.

Parameters:

request (ToolInvokeRequest) – Tool invocation request with tool name and arguments

Returns:

ToolInvokeResponse with the result or error

Return type:

ToolInvokeResponse

async dataflow.api.routes.tools_routes.list_tools()¶

List all available tools.

Returns:

ToolsListResponse containing list of available tools and total count

Return type:

ToolsListResponse

async dataflow.api.routes.tools_routes.search_tools(query=None, category=None, tool_type=None)¶

Search for tools by query, category, or type.

Parameters:
  • query (str | None) – Search query to match against tool names and descriptions

  • category (str | None) – Filter by category (e.g., ‘search’, ‘development’, ‘database’)

  • tool_type (str | None) – Filter by type (‘tool’ or ‘toolkit’)

Returns:

ToolsListResponse containing filtered list of tools

Return type:

ToolsListResponse

dataflow.api.routes.tools_routes.simple_discover_tools()¶

Simple tool discovery that always works.

Return type:

list[ToolInfo]