Scoria.MCP.Tool behaviour (scoria v0.1.0)

Copy Markdown View Source

Behaviour for defining an MCP tool.

Summary

Callbacks

Description of what the tool does

Executes the tool with validated arguments and context

Ecto schemaless map definition for tool arguments

Name of the tool

Callbacks

description()

@callback description() :: String.t()

Description of what the tool does

execute(args, context)

@callback execute(args :: map(), context :: map()) :: {:ok, any()} | {:error, any()}

Executes the tool with validated arguments and context

input_schema()

@callback input_schema() :: map()

Ecto schemaless map definition for tool arguments

name()

@callback name() :: String.t()

Name of the tool