safe_call_pattern
Explain why pcall-style protected calls cannot be recreated and return defensive Lua patterns for risky cases: nil, type, and state checks plus ok/value helper wrappers.
Instructions
Explain why pcall-style protected calls cannot be recreated and return defensive Lua patterns for known risky cases.
Context: Use when code would normally use pcall/xpcall. It returns what is possible: nil checks, type checks, state checks, and small ok/value helper wrappers.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "safe_call_pattern"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | No | generic |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||