Reorder Collections
reorder_collectionsReorder collections by assigning a new 0-based display order to each collection UUID. Provide an array of {uuid, order} objects.
Instructions
Update the display order of collections
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collections | Yes | Array of { uuid, order } objects |
Implementation Reference
- src/tools/collections.ts:134-139 (handler)The async handler function for reorder_collections that receives { collections } (array of {uuid, order}) and posts to /collections/reorder endpoint.
}, async ({ collections }) => { const result = await client.post("/collections/reorder", { collections }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); - src/tools/collections.ts:124-133 (schema)Input schema for reorder_collections: an array of objects each with a uuid (string) and order (number).
inputSchema: { collections: z .array( z.object({ uuid: z.string().describe("Collection UUID"), order: z.number().describe("New display order (0-based)"), }) ) .describe("Array of { uuid, order } objects"), }, - src/tools/collections.ts:121-139 (registration)Registration of the 'reorder_collections' tool via server.registerTool within registerCollectionTools().
server.registerTool("reorder_collections", { title: "Reorder Collections", description: "Update the display order of collections", inputSchema: { collections: z .array( z.object({ uuid: z.string().describe("Collection UUID"), order: z.number().describe("New display order (0-based)"), }) ) .describe("Array of { uuid, order } objects"), }, }, async ({ collections }) => { const result = await client.post("/collections/reorder", { collections }); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); - src/index.ts:36-36 (registration)Top-level invocation of registerCollectionTools(server, client) which registers all collection tools including reorder_collections.
registerCollectionTools(server, client); - src/tools/collections.ts:5-8 (helper)The registerCollectionTools function definition that wires up the server and client for all collection tool registrations.
export function registerCollectionTools( server: McpServer, client: ElmapiClient ): void {