11. Change the tool description by role
The same tool does more for managers. You want its one-line description to reflect that, so the LLM understands the fuller capability when it's available.
Problem. The same tool does more for managers. You want its one-line description to reflect that, so the LLM understands the fuller capability when it's available.
Solution. description is a regular method โ branch on can?.
def description
if can?(:backward_routing)
"Advance an applicant to any stage, or reroute them backward in the workflow."
else
"Advance an applicant to the next stage in their workflow."
end
endResult. Managers and operators get descriptions matched to the schema each can actually use. can? is provided by McpAuthorization::DSL and delegates to current_user.can?.
Collected from COOKBOOK.md in the repository. Edit it there, not here.