lace-app-sdk
Tools
Implement AppToolProvider to expose
custom tools. Tools run in constrained runtimes, and trust tier plus
permissions are checked before every dispatch.
app/tools.pypython
# app/tools.py — custom tools run in constrained runtimes; trust tier checked on dispatch.
from lace_app_sdk.tools import AppToolMetadata, AppToolContext
class ToolProvider:
app_id = "acme.field_intake"
def tool_metadata(self) -> AppToolMetadata:
return AppToolMetadata(
app_id=self.app_id,
bundle_id="field_intake.tools",
tool_ids=["lookup_ticket", "escalate"],
exposure_scope="agent_only",
)
def register_tools(self, registry, context: AppToolContext | None = None):
registry.register("lookup_ticket", handler=lookup_ticket)
registry.register("escalate", handler=escalate) Exposure scope
exposure_scope controls who can reach a
tool. agent_only keeps it out of
user-facing surfaces, so a tool built as an internal step of an agent loop
does not silently become something a person can invoke directly.
Checked on every dispatch
Trust tier and permissions are evaluated per call, not once at registration. An agent that gains or loses a capability between two steps of the same run is subject to the change on the next dispatch — which is what lets an approval revoke a capability mid-run rather than only before it.
Next: agents & skills.