Skip to main content

Toolkit API

Capsule API

CLI

Callable serialization

Internal callable serialization lives in heavenbase.extensions.system.capsule.serialize:
Generic JSON serialization uses the same strategy for callables and falls back to a lightweight reference for callables that cannot be captured.

Registry and metadata entities

Capsules and Toolkits persist as system entities owned by the required system extension: Workspaces also mirror mcp_profile, mcp_serializer, toolkit_family, storage_profile, sql_dialect, and database_dialect metadata into sys-metaschema rows.

Workspace MCP tools

workspace.to_mcp(...) and workspace.serve(...) assemble registered toolkit families and expose these core workspace tools: HeavenBase does not expose generic MCP alter_entity or undefine_entity tools yet because entity migration, physical cleanup, Catalog updates, and recovery semantics must be explicit before agents can safely change or drop entity definitions.

Workspace MCP profiles

MCP exposure uses declarative ProfileSpec objects (config under heavenbase.mcp.profiles.<name> or hb.ext.register_profile). Profiles compose tool groups, toolkit families (WorkspaceToolkitFamilySpec), entity/skill scopes, and a registered serializer. Profile, serializer, and family specs are mirrored to sys-metaschema and reloaded per workspace; optional extension families auto-enable their extension on first use. For simple memory workflows, use remember for summaries or decisions, recall/list_memory for exact retrieval and browsing, search_memory for fuzzy lookup, and set_memory for exact-key correction. For Memstate-style memory workflows, use profile="memstate". It prefixes keys as project.<project_id>.<keypath>, returns current rows with memstate_get, preserves prior versions for memstate_history, reports conflicting previous values on writes, and creates tombstones with memstate_delete.

Serving options

Defaults live under heavenbase.mcp:

Health check

Use a FastMCP client to verify the server can list and call tools:
result.structured_content contains the tool return value under result for scalar Python returns.

Anthropic programmatic tools

Anthropic programmatic tool calling is a separate export path from MCP connector tools:
Each definition includes allowed_callers, name, description, and input_schema. Tool execution adapters should return strings when called from code execution.