Expand description
Tool call pattern matching engine.
Provides types and functions for matching tool calls by name (glob/regex/exact) and optionally by argument-level conditions on JSON fields. Used by permission rules, reminder rules, and other extensions that need to match tool calls.
Structs§
- Field
Condition - A single field-level predicate:
path op "value". - Pattern
Parse Error - Error returned when a pattern string cannot be parsed.
- Specificity
- Specificity of a pattern match, used for priority ordering.
- Tool
Call Pattern - A complete pattern matching tool calls by name and optionally by arguments.
Enums§
- ArgMatcher
- How to match the arguments portion of a tool call.
- MatchOp
- Comparison operator for field conditions.
- Match
Result - Result of matching a pattern against a tool call.
- Path
Segment - A single segment in a dotted field path.
- Tool
IdPattern Error - Tool
Matcher - How to match the tool name portion of a call.
Functions§
- evaluate_
field_ condition - Evaluate a single field condition against a JSON value.
- evaluate_
op - Evaluate a match operator against a string value.
- op_
precision - Precision score for an operator (used in specificity).
- parse_
pattern - Parse a pattern string into a
ToolCallPattern. - pattern_
matches - Evaluate whether a pattern matches a tool call.
- resolve_
path - Resolve a dotted path against a JSON value, returning all matching leaf values.
- schema_
has_ path - Check if a JSON Schema has properties along the given path.
- tool_
id_ match - Match a tool-id glob pattern against a literal tool id.
- validate_
pattern_ fields - Validate that a pattern’s field references exist in a tool’s JSON Schema.
- validate_
tool_ id_ pattern - Validate that a tool-id pattern string is syntactically well-formed.
- value_
to_ string - Convert a JSON value to a string for matching.
- wildcard_
match - Wildcard match where
*matches any characters including/.