Mark Text Tool¶
The mark_text tool annotates spans within text using XML-style tags according to caller-supplied instructions. It accepts either inline text or a file path.
Quick start¶
Ensure your settings declare an LLM and point the tool at it:
# ~/.config/aifred-tk/settings.yml
llms:
my-llm:
provider: openai
model: gpt-4o-mini
tools:
mark_text:
llm:
type: ref
ref: my-llm
Then invoke the tool:
Output:
Configuration¶
LLM setting¶
The tools.mark_text.llm key is required. It accepts a reference to a named
LLM or an inline definition. See LLMs for the full format.
Enabling and disabling¶
The tool respects the standard enabled flag:
Usage¶
CLI¶
| Option | Description |
|---|---|
--text TEXT |
Inline text to mark. Mutually exclusive with file_path. |
--file-path PATH |
Path to a UTF-8 text file to mark. Mutually exclusive with text. |
--instructions TEXT |
Marking instructions describing what to annotate and how (max 500 characters). Required. |
--context TEXT |
Optional domain hint to resolve ambiguous terms (max 500 characters). |
MCP¶
The tool is registered automatically when the MCP server starts. Invoke it as
aifred_mark_text with the required instructions and either text or file_path.
Output¶
Result (status: ok)¶
On success, marked_text contains the annotated text.
Error (status: error)¶
{"status": "error", "message": "Provide exactly one of 'text' or 'file_path', not both or neither."}
Limits and security¶
.aiignore— when usingfile_path,mark_textchecks for.aiignorefiles from the target path up to the filesystem root. Matching files are refused immediately.- Size limit — files or inline text are limited to ensure stability. Files larger than 1 MB (1,048,576 bytes) are rejected. Inline text is capped at 100,000 characters.
- Prompt injection isolation — the text content, marking instructions, and optional context
are wrapped in XML isolation markers (
<marking_instructions>,<text_content>, and<context>) before being forwarded to the agent. This prevents the text content from being interpreted as instructions.