Skip to main content
Publish a registry of your functions so agents can discover and call them across sessions. Raysurfer auto-infers the function name, description, and input schema from the function signature, type hints, and docstring — so you don’t need to write schemas by hand. Once registered, functions can be:
  • Published to Raysurfer for agent discovery via publish_function_registry / publishFunctionRegistry
  • Converted to Anthropic tool definitions via to_anthropic_tool / toAnthropicTool for 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: If your question is “how does the function call get passed back into my agent process during execution?”, use @rs.tool / tool(...) with execute(...). See Register Python Functions or Register TypeScript Functions.

Python

Auto-inferred (no explicit params)

Name, description, and input schema are all inferred from the function name, docstring, and type hints.

With explicit description

Org/workspace scoping

Converting to Anthropic tool format

Publishing to Raysurfer

TypeScript

Auto-inferred (no explicit options)

Name and parameters are inferred from the function.

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 via publish_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:
  1. Register callbacks with @rs.tool (Python) or tool(...) (TypeScript).
  2. Call execute(...) with either user_code / userCode or optional sandbox codegen inputs.
  3. Handle results from ExecuteResult (result, error, and tool_calls / toolCalls).
Use the end-to-end guides: