tag_all_walls
Automatically generates tags for all walls in the active Revit view, placing them at each wall's midpoint. Optionally customize tag types and use leader lines for clarity.
Instructions
Create tags for all walls in the current active view. Tags will be placed at the middle point of each wall.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tagTypeId | No | The ID of the specific wall tag family type to use. If not provided, the default wall tag type will be used | |
| useLeader | No | Whether to use a leader line when creating the tags |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"tagTypeId": {
"description": "The ID of the specific wall tag family type to use. If not provided, the default wall tag type will be used",
"type": "string"
},
"useLeader": {
"default": false,
"description": "Whether to use a leader line when creating the tags",
"type": "boolean"
}
},
"type": "object"
}
Implementation Reference
- src/tools/tag_all_walls.ts:20-47 (handler)The handler function for the 'tag_all_walls' tool. It extracts parameters, uses withRevitConnection to send a 'tag_walls' command to the Revit client, and returns the response or error message.async (args, extra) => { const params = args; try { const response = await withRevitConnection(async (revitClient) => { return await revitClient.sendCommand("tag_walls", params); }); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Wall tagging failed: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } }
- src/tools/tag_all_walls.ts:9-19 (schema)Zod schema defining the input parameters for the tool: useLeader (optional boolean, defaults to false) and tagTypeId (optional string).{ useLeader: z .boolean() .optional() .default(false) .describe("Whether to use a leader line when creating the tags"), tagTypeId: z .string() .optional() .describe("The ID of the specific wall tag family type to use. If not provided, the default wall tag type will be used"), },
- src/tools/tag_all_walls.ts:5-49 (registration)The registration function registerTagAllWallsTool that sets up the 'tag_all_walls' tool on the MCP server, including name, description, input schema, and handler. This function is dynamically called during tool registration in src/tools/register.ts.export function registerTagAllWallsTool(server: McpServer) { server.tool( "tag_all_walls", "Create tags for all walls in the current active view. Tags will be placed at the middle point of each wall.", { useLeader: z .boolean() .optional() .default(false) .describe("Whether to use a leader line when creating the tags"), tagTypeId: z .string() .optional() .describe("The ID of the specific wall tag family type to use. If not provided, the default wall tag type will be used"), }, async (args, extra) => { const params = args; try { const response = await withRevitConnection(async (revitClient) => { return await revitClient.sendCommand("tag_walls", params); }); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Wall tagging failed: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } } ); }