A tool: use Sake.Tool with options, arg lines, an optional output
block, and execute/2.
defmodule MyApp.MCP.SearchIssues do
use Sake.Tool, name: "search_issues", description: "Search issues", scope: "issues:read"
arg :query, :string, required: true
@impl true
def execute(%{query: q}, ctx), do: {:ok, Issues.search(ctx.scope, q)}
endOptions: name (default: the module's last segment in snake case),
title, description, icons, scope (one or many), annotations
(read_only, destructive, idempotent, open_world), stream,
ttl, meta, input_schema (a schema map instead of arg lines).
Summary
Functions
Declares an argument (or, inside output, an output property).
Declares the output schema with arg lines.