Replace
Substitutes regular-expression matches in a string with a replacement value, supporting capture-group references and preserving the input literal's datatype or language tag.
Instructions
Replaces occurrences of a regular-expression pattern in an input string, per SPARQL's REPLACE() / XPath fn:replace. The replacement string may reference capture groups as $1, $2, ...; flags s, m, i, x, q are supported. The result is a string literal of the same kind (datatype/language tag) as the input.
Note: this function should not be used to build URIs! That should be done using EncodeForURI()/ResolveURI().
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input": "<input>",
"pattern": "<pattern>",
"replacement": "<replacement>"
},
"name": "Replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | Optional XPath regex flags: any of s, m, i, x, q | |
| input | Yes | The input string to process | |
| pattern | Yes | The regular expression to be replaced (XPath fn:replace syntax) | |
| replacement | Yes | The replacement string; $1, $2, ... reference capture groups |