calculate_annotation_position
Calculate character offset and length for Cookidoo recipe-step annotations (TTS, MODE, INGREDIENT, VOLUME), translating JavaScript UTF-16 positions to Python indexes even with emoji.
Instructions
Calculate Cookidoo's offset and length for text inside a recipe step.
Cookidoo uses JavaScript UTF-16 character positions, which differ from normal Python string indexes when text before the marker contains emoji. Use this tool for every TTS, MODE, INGREDIENT, and VOLUME annotation.
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": {
"text": "<text>",
"marker": "<marker>"
},
"name": "calculate_annotation_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| marker | Yes | ||
| occurrence | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |