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.

Attributes¶

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(→ list[ToolInfo])

Discover all available tools from haive-tools package.

get_tool_details(→ dict[str, Any])

Get detailed information about a specific tool.

get_tool_schema(→ dict[str, Any])

Extract input schema from a tool module.

get_tool_schema_endpoint(→ ToolSchema)

Get the input/output schema for a specific tool.

get_tool_schema_for_name(→ dict[str, Any])

Extract input schema for a specific tool by name.

invoke_tool(→ Any)

Invoke a tool with given arguments.

invoke_tool_endpoint(→ ToolInvokeResponse)

Invoke a tool with the provided arguments.

list_tools(→ ToolsListResponse)

List all available tools.

search_tools(→ ToolsListResponse)

Search for tools by query, category, or type.

simple_discover_tools(→ list[ToolInfo])

Simple tool discovery that always works.

Module Contents¶

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

Bases: pydantic.BaseModel

Information about a tool.

category: str = None¶
description: str = None¶
module: str = None¶
name: str = None¶
type: str = None¶
class dataflow.api.routes.tools_routes.ToolInvokeRequest(/, **data: Any)¶

Bases: pydantic.BaseModel

Request to invoke a tool.

arguments: dict[str, Any] = None¶
tool_name: str = None¶
class dataflow.api.routes.tools_routes.ToolInvokeResponse(/, **data: Any)¶

Bases: pydantic.BaseModel

Response from tool invocation.

error: str | None = None¶
result: Any = None¶
success: bool = None¶
class dataflow.api.routes.tools_routes.ToolSchema(/, **data: Any)¶

Bases: pydantic.BaseModel

Tool input/output schema information.

description: str = None¶
input_schema: dict[str, Any] = None¶
name: str = None¶
output_schema: dict[str, Any] | None = None¶
class dataflow.api.routes.tools_routes.ToolsListResponse(/, **data: Any)¶

Bases: pydantic.BaseModel

Response for tools list endpoint.

count: int = None¶
tools: list[ToolInfo] = None¶
dataflow.api.routes.tools_routes.discover_tools() list[ToolInfo]¶

Discover all available tools from haive-tools package.

async dataflow.api.routes.tools_routes.get_tool_details(tool_name: str) dict[str, Any]¶

Get detailed information about a specific tool.

Parameters:

tool_name – Name of the tool to get details for

Returns:

Detailed information about the tool

dataflow.api.routes.tools_routes.get_tool_schema(tool_module_path: str) dict[str, Any]¶

Extract input schema from a tool module.

async dataflow.api.routes.tools_routes.get_tool_schema_endpoint(tool_name: str) ToolSchema¶

Get the input/output schema for a specific tool.

Parameters:

tool_name – Name of the tool to get schema for

Returns:

ToolSchema containing input and output schemas

dataflow.api.routes.tools_routes.get_tool_schema_for_name(tool_module_path: str, target_tool_name: str) dict[str, Any]¶

Extract input schema for a specific tool by name.

async dataflow.api.routes.tools_routes.invoke_tool(tool_module_path: str, arguments: dict[str, Any]) Any¶

Invoke a tool with given arguments.

async dataflow.api.routes.tools_routes.invoke_tool_endpoint(request: ToolInvokeRequest) ToolInvokeResponse¶

Invoke a tool with the provided arguments.

Parameters:

request – Tool invocation request with tool name and arguments

Returns:

ToolInvokeResponse with the result or error

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

List all available tools.

Returns:

ToolsListResponse containing list of available tools and total count

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

Search for tools by query, category, or type.

Parameters:
  • query – Search query to match against tool names and descriptions

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

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

Returns:

ToolsListResponse containing filtered list of tools

dataflow.api.routes.tools_routes.simple_discover_tools() list[ToolInfo]¶

Simple tool discovery that always works.

dataflow.api.routes.tools_routes.logger¶
dataflow.api.routes.tools_routes.router¶