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/sort-lines
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/sort-lines/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.
lines· string · required- Enter one item per line.
operation· string · required-
Choose the operation that matches the calculation. Accepted values:
alphabetical, reverse_alpha, numeric, reverse, shuffle. case_sensitive· boolean · optional- Turn case-sensitive sorting on or off.
remove_duplicates· boolean · optional- Turn remove duplicate lines on or off.
remove_blank_lines· boolean · optional- Turn remove blank lines on or off.
{
"type": "object",
"properties": {
"lines": {
"type": "string",
"description": "Enter one item per line."
},
"operation": {
"type": "string",
"description": "Choose the operation that matches the calculation.",
"enum": [
"alphabetical",
"reverse_alpha",
"numeric",
"reverse",
"shuffle"
]
},
"case_sensitive": {
"type": "boolean",
"description": "Turn case-sensitive sorting on or off."
},
"remove_duplicates": {
"type": "boolean",
"description": "Turn remove duplicate lines on or off."
},
"remove_blank_lines": {
"type": "boolean",
"description": "Turn remove blank lines on or off."
}
},
"required": [
"lines",
"operation"
],
"additionalProperties": false
}
Output schema
On a successful execution, schema values appear in data.result.values.
result· string- Processed lines produced by the calculation.
input_line_count· number- Input lines produced by the calculation.
output_line_count· number- Output lines produced by the calculation.
duplicates_removed· number- Duplicates removed produced by the calculation.
{
"type": "object",
"properties": {
"result": {
"type": "string",
"description": "Processed lines produced by the calculation."
},
"input_line_count": {
"type": "number",
"description": "Input lines produced by the calculation."
},
"output_line_count": {
"type": "number",
"description": "Output lines produced by the calculation."
},
"duplicates_removed": {
"type": "number",
"description": "Duplicates removed produced by the calculation."
}
},
"additionalProperties": false
}
Sort Lines 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/sort-lines/execute" \
-H "Content-Type: application/json" \
-d '{
"lines": "pear\nApple\nbanana\napple",
"operation": "alphabetical",
"case_sensitive": false,
"remove_duplicates": true,
"remove_blank_lines": true
}'
{
"ok": true,
"data": {
"slug": "sort-lines",
"result": {
"values": {
"result": "Apple\nbanana\npear",
"input_line_count": 4,
"output_line_count": 3,
"duplicates_removed": 1
},
"display": {
"display": "Apple\nbanana\npear"
},
"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.