ExUtcp.Tools (ex_utcp v0.2.8)

View Source

Tool definitions and management for UTCP.

This module handles tool schemas, registration, and discovery.

Summary

Functions

Extracts the provider name from a full tool name.

Extracts the tool name without provider prefix.

Checks if a tool matches a search query.

Creates a new tool input/output schema.

Creates a new tool definition.

Normalizes tool name by ensuring it has a provider prefix.

Validates a tool definition.

Functions

extract_provider_name(full_name)

@spec extract_provider_name(String.t()) :: String.t()

Extracts the provider name from a full tool name.

extract_tool_name(full_name)

@spec extract_tool_name(String.t()) :: String.t()

Extracts the tool name without provider prefix.

matches_query?(tool, query)

@spec matches_query?(ExUtcp.Types.tool(), String.t()) :: boolean()

Checks if a tool matches a search query.

new_schema(opts \\ [])

Creates a new tool input/output schema.

new_tool(opts)

@spec new_tool(keyword()) :: ExUtcp.Types.tool()

Creates a new tool definition.

normalize_name(tool_name, provider_name)

@spec normalize_name(String.t(), String.t()) :: String.t()

Normalizes tool name by ensuring it has a provider prefix.

validate_tool(tool)

@spec validate_tool(ExUtcp.Types.tool()) :: :ok | {:error, String.t()}

Validates a tool definition.