- Published to Raysurfer for agent discovery via
publish_function_registry/publishFunctionRegistry - Converted to Anthropic tool definitions via
to_anthropic_tool/toAnthropicToolfor direct use with Claude’s tool calling - Tracked automatically — every call records execution duration, inputs, outputs, and success/failure
Which Path Passes Functions Back To The Running Agent?
These three paths are related, but they are not the same runtime:| Path | Purpose | How functions are wired at runtime |
|---|---|---|
publish_function_registry / publishFunctionRegistry | Persist reusable functions for discovery across sessions | Functions are uploaded as registry snippets and made available to Raysurfer sandbox runs for that scope |
to_anthropic_tool / toAnthropicTool | Generate Anthropic-compatible tool schemas | You pass the returned schema to your Claude tool-calling loop and handle tool execution in your app |
@rs.tool / tool(...) + execute(...) | Live tool calling in Raysurfer sandbox | Raysurfer opens a callback channel and routes each tool call back to your local callback during execution |
@rs.tool / tool(...) with execute(...). See Register Python Functions or Register TypeScript Functions.
Python
Auto-inferred (no explicit params)
With explicit description
Org/workspace scoping
Converting to Anthropic tool format
Publishing to Raysurfer
TypeScript
Auto-inferred (no explicit options)
With explicit options
Org/workspace scoping
Converting to Anthropic tool format
Publishing to Raysurfer
Persistent Sandbox
Previously published functions are available in the sandbox execution environment, scoped by org and workspace. When an agent runs code through Raysurfer’s sandbox, functions published viapublish_function_registry / publishFunctionRegistry for that scope are available without re-uploading each session.
For live callback routing during a run, use @rs.tool / tool(...) with execute(...).
Running In Raysurfer Sandbox
To run a coding agent in Raysurfer’s remote sandbox with tool callbacks:- Register callbacks with
@rs.tool(Python) ortool(...)(TypeScript). - Call
execute(...)with eitheruser_code/userCodeor optional sandbox codegen inputs. - Handle results from
ExecuteResult(result,error, andtool_calls/toolCalls).
