Skip to main content

is_cacheable

Function is_cacheable 

Source
pub fn is_cacheable(tool_name: &str, is_mcp: bool) -> bool
Expand description

Returns true if the tool’s results can be safely cached.

is_mcp must be resolved by the caller via ToolDef::is_mcp_tool (server_id.is_some()). Real MCP tool ids are {server_id}_{name} (McpTool::sanitized_id) and carry no reliable string prefix to pattern-match on here (#5712, #5733), so this function cannot infer MCP origin from tool_name alone. MCP-origin tools are always non-cacheable by default since they are third-party and may have unknown side effects.