printf
Format strings with printf-style specifiers like %s, %d, %f. Returns JSON formatted output or plain text with --raw. Ideal for precise number formatting, padding, and type conversion.
Instructions
Format and print text using printf-style conversion specifiers (%s, %d, %f, etc.). Read-only, no side effects. Returns JSON with the formatted string by default; use --raw for plain output. Use for precise control over number formatting, padding, and type conversion. Not for simple echo without formatting — use 'echo'. See also 'echo'.
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": {
"format_string": "<format_string>"
},
"name": "printf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write formatted text without a JSON envelope. | |
| values | No | Values used by format conversions. | |
| encoding | No | Output encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| format_string | Yes | Printf-style format string. | |
| show_encoding | No | Include encoding detection metadata in JSON result. | |
| encoding_errors | No | How to handle encoding errors (default: replace). | replace |
| encoding_profile | No | Locale-aware encoding fallback profile for auto-detection. |