K

MCP tools reference

Every tool a connected AI agent gets from UI Rules over MCP: what each one is for, the order the server asks agents to use them in, and which connection-key scope each needs.
PreviousNext

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:

  1. get_project_notes, to pick up what earlier sessions on this project decided.
  2. get_rules_index, which returns the map of everything the brand has rules about, with counts but no rule text.
  3. 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.
  4. get_design_tokens, for the stylesheet and the canonical values.
  5. Then, per element it builds, get_rules for that area by name, or search_rules when it has a concept but no area name. Any user-facing text it writes goes the same way: it loads your content area first.
  6. check_rule_compliance at 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.
  7. report_usage and save_project_notes to 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.

ToolWhat it does
get_rules_indexThe 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_rulesOne 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_rulesRules 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_ruleOne rule by its id or key, when the agent already has it.
get_design_tokensThe 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_complianceThe 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_stylesheetChecks 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_rulesetThe whole effective ruleset as one Markdown document, for dropping into a repo or reading end to end.
list_brand_assetsThe 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.

ToolWhat it doesScope
get_project_notesThe notes saved by earlier sessions on this project: checklist, conventions, files, memory.notes:read
save_project_notesSaves one note per kind, replacing the last.notes:write
report_usageA self-check after compliance: what was applied, what was skipped, and why.usage:write
send_feedbackA 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).

ToolWhat it doesScope
add_project_ruleAdds 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_ruleChanges 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_tokenSets one token's value for this project, as an override. The brand keeps its own value.token:write
import_design_tokensTakes 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_siteReads 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 429 with 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 nameCurrent name
get_notesget_project_notes
get_rulesetget_rules_index
list_rule_areasget_rules_index
list_rule_nodesget_rules_index
get_tokensget_design_tokens
validatecheck_rule_compliance
add_ruleadd_project_rule
set_tokenset_design_token
import_tokensimport_design_tokens
scan_siteimport_design_tokens_from_site
list_assetslist_brand_assets
save_notesave_project_notes
export_markdownexport_ruleset
override_ruleupdate_rule

Bring your brand to every AI tool

Set your rules once and use them in every AI tool you work in.