MCP tools reference
When an AI tool connects to UI Rules over MCP, it gets a set of tools. Most read your brand. A few write to it, and each of those needs a scope on the connection key that is never granted by default. This page lists all of them, so you can tell what an agent is doing when it reports a call, and so you can grant exactly the access you mean to.
The tools are named the way the agent sees them. You do not call them yourself.
The order the server asks agents to follow
The MCP server carries its own instructions, and a connected agent follows them without you scripting anything. The order is:
get_project_notes, to pick up what earlier sessions on this project decided.get_rules_index, which returns the map of everything the brand has rules about, with counts but no rule text.- A look at the project itself, using only what the index gave it: is a component library already installed? If your rules name one and the project does not have it, the agent is told to stop and say so rather than build lookalikes and carry on.
get_design_tokens, for the stylesheet and the canonical values.- Then, per element it builds,
get_rulesfor that area by name, orsearch_ruleswhen it has a concept but no area name. Any user-facing text it writes goes the same way: it loads your content area first. check_rule_complianceat the end. The agent declares the files it touched, the areas those files touch, and the full text of the project's stylesheet; the call verifies token delivery server-side and hands back a verdict, the Required rules for what was declared, and the closing report to give you.report_usageandsave_project_notesto close the session out.
The custom instruction the v0 and Lovable guides ask you to paste is this order in a sentence, because those tools do not read the server's instructions on their own.
Reading tools
These need only a read scope. A Delivery only key carries all of them.
| Tool | What it does |
|---|---|
get_rules_index | The index of every area the brand has rules about: each area's exact name, its rule count, and how many are Required. No rule text, so the agent reads it as a table of contents. It can also open one branch to its full depth, and a branch small enough to fit comes back with its rules included. |
get_rules | One area's rules in full, named exactly as the index printed it. A top-level name such as Components serves the whole section, capped. If the project is delivering a pinned version, that is what comes back; live: true reads the live ruleset instead. |
search_rules | Rules for a concept the agent cannot name an area for: a focus ring, dark mode, the tone of an error message. Ranked, capped, and honest when nothing matches. |
get_rule | One rule by its id or key, when the agent already has it. |
get_design_tokens | The project's design tokens: the compiled stylesheet first, ready to paste, then the canonical values for reference. The agent has to say which dialect the project uses, css, tailwind-v4, or tailwind-v3, and it is told to read that from the project's own package.json rather than guess. |
check_rule_compliance | The closing gate. The agent declares the files it changed, the areas those files touch, and the stylesheet it wrote; the call checks token delivery against the canonical export, returns the Required rules for what was declared, and ends with the report to hand you. Anything left out comes back stamped as unchecked. |
verify_stylesheet | Checks a stylesheet the agent just wrote against the canonical export and returns the exact lines to add or fix. On tailwind-v3 it takes the tailwind.config text too, or only half the delivery is checked. |
export_ruleset | The whole effective ruleset as one Markdown document, for dropping into a repo or reading end to end. |
list_brand_assets | The brand's logo, fonts, icons, images, and documents, each with a permanent URL. This is the only tool that serves the logo. The URLs are download sources: the agent is told to save each file into the project and reference the local path, so the site it builds serves its own copy. Assets belong to the brand, so every project shares them. |
Session tools
These let an agent keep its own working state on a project. They write to UI Rules' own storage, never to your rules or tokens. The Agent sessions scope group grants them.
| Tool | What it does | Scope |
|---|---|---|
get_project_notes | The notes saved by earlier sessions on this project: checklist, conventions, files, memory. | notes:read |
save_project_notes | Saves one note per kind, replacing the last. | notes:write |
report_usage | A self-check after compliance: what was applied, what was skipped, and why. | usage:write |
send_feedback | A free-text message to whoever runs the design system, for a rule that was ambiguous or a token that was missing. Changes nothing else. | feedback:write |
Without these scopes the session tools fail closed and everything else keeps working.
Writing tools
These change your design system. Each needs its own scope from the Authoring group, and none is granted by default. Every one of them tells the agent to confirm with the user before it writes, because the change takes effect immediately and there is no undo from the tool side (though Version history still has you covered).
| Tool | What it does | Scope |
|---|---|---|
add_project_rule | Adds a rule to this project, attached to the node the agent names. It cannot change the brand's own ruleset, and no other project sees it. | rule:write |
update_rule | Changes an existing rule for this project: a different Guidance, Importance, title, or body. A rule the project owns changes in place; an inherited one is customized for this project only, and the brand keeps its own. Withdrawing a field on an inherited rule puts the brand's own value back. | rule:write |
set_design_token | Sets one token's value for this project, as an override. The brand keeps its own value. | token:write |
import_design_tokens | Takes a block of CSS the user pasted and previews what would change; writes nothing until apply=true. Defaults to project overrides. | token:write for the project, token:import for the brand |
import_design_tokens_from_site | Reads a website's tokens into the project or brand. Previews first, reads only the URL the user gave, and writes nothing until apply=true. | token:import |
Writing to the brand rather than a project is deliberately the bigger grant. token:import is what lets an import rewrite the canon every project inherits, and it is separate from token:write for that reason.
Granting scopes
The Connect your AI tools dialog offers presets when it creates a key: Full access, Read only, Delivery only, and None. Delivery only is enough for serving. Add the Agent sessions group when you want the agent to remember work between sessions, and Authoring only when you want a tool to be able to change things.
A tool a key is not allowed to use is simply not offered to the agent, so a read-only key never sees the writing tools at all.
Limits
Two limits apply to every connected tool:
- A per-minute rate limit on the endpoint. Past it, calls get a
429with a retry-after and the message "Rate limit exceeded. Slow down and retry shortly." - The plan's MCP calls per month. Past it, calls get "Plan limit reached" and stop until the meter resets. A call denied over the limit still counts. See Usage for where you stand.
Renamed tools
If a saved instruction names a tool that is not on this page, it is probably an earlier name. The old names are not served: an agent that calls one gets an error saying what the tool is called now, and is told to let you know so you can update the instruction. That matters most for the text pasted into v0's Custom Instructions or Lovable's Workspace knowledge, which nothing on the server can update for you.
| Old name | Current name |
|---|---|
get_notes | get_project_notes |
get_ruleset | get_rules_index |
list_rule_areas | get_rules_index |
list_rule_nodes | get_rules_index |
get_tokens | get_design_tokens |
validate | check_rule_compliance |
add_rule | add_project_rule |
set_token | set_design_token |
import_tokens | import_design_tokens |
scan_site | import_design_tokens_from_site |
list_assets | list_brand_assets |
save_note | save_project_notes |
export_markdown | export_ruleset |
override_rule | update_rule |
