Skip to main content

classify_operation

Function classify_operation 

Source
pub fn classify_operation(
    method: &str,
    tool_name: Option<&str>,
) -> OperationType
Expand description

Classify an MCP request by its operation type.

Uses method + tool name patterns:

  • resources/read, resources/subscribe, completion/complete → Read
  • Tool names containing “read”, “get”, “list”, “search”, “view”, “describe” → Read
  • Tool names containing “delete”, “remove”, “drop”, “purge” → Delete
  • Tool names containing “admin”, “manage”, “configure”, “grant”, “revoke” → Admin
  • Everything else (including “write”, “create”, “update”, “set”, “put”) → Write