reorder_visible_columns
Reorder visible columns for a table's view context using column indices or names, with changes staged until apply_annotations() is called.
Instructions
Reorder columns in the visible-columns list for a specific context.
This is a convenience tool for reordering columns without manually reconstructing the list. Changes are staged until apply_annotations() is called.
Args: table_name: Name of the table. context: The context to modify (e.g., "compact", "detailed"). new_order: The new order specification. Can be: - List of indices: [2, 0, 1, 3] reorders by current positions - List of column names/refs: ["Name", "RID", ...] specifies exact order
Returns: JSON with the reordered column list for the context.
Examples: # Reorder by indices (move item at index 2 to front) reorder_visible_columns("Image", "compact", [2, 0, 1, 3, 4])
# Reorder by specifying exact column order
reorder_visible_columns("Image", "compact", ["Filename", "Subject", "RID"])
# Note: When using column names, all columns must be included
# or unmentioned columns will be removed from the list
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | Yes | ||
| new_order | Yes | ||
| table_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |