← All tool references

Text Tools · not_available

Text Compare Tool

Compare two text blocks line by line and summarize added, removed, unchanged, and modified content.

Open public tool

Overview

Category
Text Tools
API mode
not_available
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/text-compare-tool

View this descriptor as JSON

Execute availability

This tool is documented as a browser capability. Its execute route does not produce a server-side result; when execution is enabled, it responds with browser_interaction_required and points callers to the public tool page.

POST /api/v1/tools/text-compare-tool/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

original_text · string · required
Enter the original text.
revised_text · string · required
Enter the revised text.
ignore_case · boolean · optional
Turn ignore letter case on or off.
ignore_whitespace · boolean · optional
Turn ignore surrounding whitespace on or off.
{
    "type": "object",
    "properties": {
        "original_text": {
            "type": "string",
            "description": "Enter the original text."
        },
        "revised_text": {
            "type": "string",
            "description": "Enter the revised text."
        },
        "ignore_case": {
            "type": "boolean",
            "description": "Turn ignore letter case on or off."
        },
        "ignore_whitespace": {
            "type": "boolean",
            "description": "Turn ignore surrounding whitespace on or off."
        }
    },
    "required": [
        "original_text",
        "revised_text"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

similarity_percent · number
Line similarity produced by the calculation.
added_lines · number
Added lines produced by the calculation.
removed_lines · number
Removed lines produced by the calculation.
unchanged_lines · number
Unchanged lines produced by the calculation.
diff · array
Line-by-line differences produced by the calculation.
{
    "type": "object",
    "properties": {
        "similarity_percent": {
            "type": "number",
            "description": "Line similarity produced by the calculation."
        },
        "added_lines": {
            "type": "number",
            "description": "Added lines produced by the calculation."
        },
        "removed_lines": {
            "type": "number",
            "description": "Removed lines produced by the calculation."
        },
        "unchanged_lines": {
            "type": "number",
            "description": "Unchanged lines produced by the calculation."
        },
        "diff": {
            "type": "array",
            "description": "Line-by-line differences produced by the calculation."
        }
    },
    "additionalProperties": false
}

Text Compare Tool example

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/text-compare-tool/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "original_text": "UtilityPages\nFast tools\nNo login required",
    "revised_text": "UtilityPages\nPrivate browser tools\nNo login required",
    "ignore_case": false,
    "ignore_whitespace": false
}'
{
    "ok": true,
    "data": {
        "slug": "text-compare-tool",
        "result": {
            "values": {
                "similarity_percent": 66.6700000000000017053025658242404460906982421875,
                "added_lines": 1,
                "removed_lines": 1,
                "unchanged_lines": 2,
                "diff": [
                    {
                        "type": "unchanged",
                        "line": "UtilityPages"
                    },
                    {
                        "type": "added",
                        "line": "Private browser tools"
                    },
                    {
                        "type": "removed",
                        "line": "Fast tools"
                    },
                    {
                        "type": "unchanged",
                        "line": "No login required"
                    }
                ]
            },
            "display": {
                "display": "66.67"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.