module
MCP::Tools
Included Modules
Defined in:
mcp/tools.crConstant Summary
-
Log =
::Log.for("mcp")
-
NAME_REGEX =
/^([a-zA-Z0-9_-]+|hashtag#[a-zA-Z0-9_-]+|mention@[[email protected]]+)$/
-
TOOL_DEFINITIONS =
[{name: "paginate_collection", description: "Paginate through collections of ActivityPub objects, activities, and actors. Use this tool when you want to inspect the contents of a collection.", properties: [{name: "name", type: "string", description: "Name of the collection to paginate", required: true, matches: NAME_REGEX}, {name: "page", type: "integer", description: "Page number (optional, defaults to 1)", minimum: 1, default: 1}, {name: "size", type: "integer", description: "Number of items per page (optional, defaults to 10, maximum 1000)", minimum: 1, maximum: 20, default: 10}]}, {name: "count_collection_since", description: "Count items in ActivityPub collections since a given time. Use this tool when you want to know if new items have been added in the last day/week/month.", properties: [{name: "name", type: "string", description: "Name of the collection to count", required: true, matches: NAME_REGEX}, {name: "since", type: "time", description: "Time (RFC3339) to count from", required: true}]}, {name: "read_resources", description: "Read one or more resources by URI (format \"ktistec://{resource}/{id*}\"). Supports all resource types including templated resources (actors, objects) and static resources (information, users). Supports batched reads (comma-separated IDs of resources of the same type). Use this tool as a universal fallback when resources are not supported by an MCP client.", properties: [{name: "uris", type: "array", description: "Resource URIs to read (e.g., ['ktistec://actors/123,456', 'ktistec://objects/456,789'])", required: true, items: "string"}]}] of ToolDefinition
Class Method Summary
- .handle_tool_count_collection_since(params : JSON::Any, account : Account) : JSON::Any
- .handle_tool_paginate_collection(params : JSON::Any, account : Account) : JSON::Any
- .handle_tool_read_resources(params : JSON::Any, account : Account) : JSON::Any
- .handle_tools_call(request : JSON::RPC::Request, account : Account) : JSON::Any
- .handle_tools_list(request : JSON::RPC::Request) : JSON::Any