codemap_routine_remove_macro

Remove a macro from a routine.

routinemacroworkflow

Parameters

NameTypeRequiredDescription
routineNamestring✅ RequiredRoutine name
macroNamestring✅ RequiredMacro name to remove

Usage Examples

MCP Usage (for AI Agents like Claude)

json
{
  "name": "codemap_routine_remove_macro",
  "arguments": {
    "routineName": "build",
    "macroName": "old-compile"
  }
}

Example Output

JSON Response

json
{
  "success": true,
  "message": "Removed macro \"build-legacy\" from routine \"release-workflow\"."
}
ℹ️When to Use This Tool
    Use codemap_routine_remove_macro when you need to:
  • Remove deprecated or obsolete macros from routines
  • Clean up routines after workflow changes
  • Refactor routines by removing and re-adding macros in new order
  • Fix routines that reference deleted macros
  • Simplify workflows by removing unnecessary automation
💡Common Patterns
Deprecation Workflow
Remove outdated macro from routine:
1. Verify macro still in routine: codemap_routine_list()
2. Remove: codemap_routine_remove_macro({
routineName: "deploy",
macroName: "old-build-script"
})
3. Optionally delete macro: codemap_macro_delete({ name: "old-build-script" })


Routine Refactoring
Reorganize workflow execution order:
1. Remove macros: codemap_routine_remove_macro({ routineName: "build", macroName: "test" })
2. Remove macros: codemap_routine_remove_macro({ routineName: "build", macroName: "lint" })
3. Re-add in new order (lint → test)


Cleanup After Macro Deletion
Remove references to deleted macro:
1. Delete macro: codemap_macro_delete({ name: "legacy-deploy" })
2. Clean up routines:
codemap_routine_remove_macro({ routineName: "prod-deploy", macroName: "legacy-deploy" })
codemap_routine_remove_macro({ routineName: "staging-deploy", macroName: "legacy-deploy" })
💡Pro Tips
  • Routine continues without macro: Removing macro doesn't affect other routine steps
  • No error if macro already removed: Tool is idempotent - safe to call multiple times
  • Use list to verify: Check codemap_routine_list to see current macros before removing
  • Order doesn't matter for removal: Can remove macros in any order, not just reverse of adding
  • Macro itself unchanged: Removing from routine doesn't delete the macro - it's still available
Best Practices
  • Verify routine contents before removing macros to avoid mistakes
  • Document why macros are removed using routine messages
  • Remove obsolete macros promptly to keep workflows clean
  • Test routine after removing macros to ensure it still works correctly
  • Consider if macro should be deleted entirely or just removed from this routine
⚠️Common Mistakes
Mistake: Removing macro from non-existent routine
codemap_routine_remove_macro({ 
routineName: "deploy-v2", // Routine doesn't exist
macroName: "build"
})
// Error: Routine "deploy-v2" not found

Instead: Verify routine exists
const routines = await codemap_routine_list();
if (routines.routines.some(r => r.name === "deploy-v2")) {
codemap_routine_remove_macro({ routineName: "deploy-v2", macroName: "build" })
}


---

Mistake: Assuming macro is deleted
// Remove from routine
codemap_routine_remove_macro({
routineName: "deploy",
macroName: "old-build"
})

// Try to use macro in different routine
codemap_routine_add_macro({
routineName: "test-workflow",
macroName: "old-build"
})
// This works - macro still exists!

Instead: Understand removal vs deletion
// Removes from routine only
codemap_routine_remove_macro({ routineName: "deploy", macroName: "old-build" })

// To fully delete macro:
codemap_macro_delete({ name: "old-build" })


---

Mistake: Removing critical macro without replacement
// Remove build step from release routine
codemap_routine_remove_macro({
routineName: "release",
macroName: "build-prod"
})
// Now releases without building!

Instead: Add replacement before removing
// Add new build macro first
codemap_routine_add_macro({
routineName: "release",
macroName: "build-prod-v2"
})

// Then remove old one
codemap_routine_remove_macro({
routineName: "release",
macroName: "build-prod"
})


---

Mistake: Not updating documentation after removal
codemap_routine_remove_macro({ 
routineName: "deploy",
macroName: "docker-push"
})
// Routine message still mentions docker-push

Instead: Update routine message
codemap_routine_remove_macro({ 
routineName: "deploy",
macroName: "docker-push"
})
codemap_routine_set_message({
routineName: "deploy",
message: "Deploy workflow - removed docker-push, now using k8s-deploy directly"
})


---

Mistake: Removing wrong macro due to typo
codemap_routine_remove_macro({ 
routineName: "build",
macroName: "tets" // Typo: should be "test"
})
// Silently succeeds if "tets" macro doesn't exist in routine

Instead: Verify macro name
const routine = await codemap_routine_list();
const buildRoutine = routine.routines.find(r => r.name === "build");
console.log("Current macros:", buildRoutine.macros);

// Then remove with correct name
codemap_routine_remove_macro({
routineName: "build",
macroName: "test"
})