> ## Documentation Index
> Fetch the complete documentation index at: https://developer.dittowords.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Example use cases

> Example prompts and instructions for using the Ditto MCP server with AI coding agents

The Ditto MCP server works best when you give your AI agent instructions about when and how to use its tools. You can include these instructions directly in a prompt, or add them to a project-level configuration file like `CLAUDE.md` (Claude Code), `.cursorrules` (Cursor), or similar.

Below are example instructions organized by tool.

## Style guide rules

The `get_styleguide_rules` tool lets your agent fetch your team's content rules and apply them when writing UI text.

### Generate UI with compliant text

Add this to your agent instructions to apply style guide rules whenever the agent creates new UI:

```
Use the style guides in Ditto to generate UI with compliant text.
```

The agent will call `get_styleguide_rules` before writing any user-facing strings, and apply those rules to the text it generates.

### Audit existing strings

You can also use the tool to check and fix text that already exists in your codebase:

```
Check my existing user-facing strings and update them so they comply
with style guide rules in Ditto.
```

The agent will fetch your rules, scan your code for user-facing strings, and suggest updates where the text doesn't match your guidelines.

## Text search and reuse

The `search_ditto_text` tool lets your agent find and reuse strings that already exist in your Ditto projects.

### Reuse text when generating UI

Add this instruction so your agent checks Ditto for existing text before writing new copy:

```
Try to reuse text in Ditto when generating UI.
```

When the agent needs to add a button label, heading, or other UI string, it will search Ditto first and reference existing text when a match is found.

### Replace hardcoded strings

You can ask the agent to scan your codebase and swap hardcoded strings for existing Ditto text:

```
Look at my existing user-facing strings in my codebase and see if you
can replace any with text that exists in Ditto.
```

The agent will search Ditto for matches against your current strings and suggest replacements where equivalent text already exists.

## Combining tools

For the best results, combine both tools in your agent instructions:

```
When working on UI:
- Use the style guides in Ditto to ensure all user-facing text follows
  our content guidelines.
- Try to reuse existing text from Ditto instead of writing new copy.
```

This way, the agent will both check for existing text to reuse and validate any new text it writes against your style guide rules.

## Managing style guide rules

The `create_styleguide_rule`, `update_styleguide_rule`, and `delete_styleguide_rule` tools let your agent manage your style guide. The `get_workspace_tags` tool lists the tags available to attach to a rule.

### Turn a code review comment into a rule

When you notice a recurring content issue, ask the agent to capture it as a rule so future text follows it automatically:

```
We keep shipping error messages that blame the user. Add a Ditto style
guide rule that error messages should be neutral and solution-oriented,
with an example like "You entered an invalid email" → "Enter a valid
email address."
```

The agent calls `get_styleguide_rules` to find the target style guide and section, calls `get_workspace_tags` if it wants to tag the rule, then calls `create_styleguide_rule`.

### Refine an existing rule

```
Our "date formatting" rule in Ditto only covers full dates. Update it to
also specify that relative times like "2 hours ago" are lowercase.
```

The agent calls `get_styleguide_rules` to find the rule ID, then calls `update_styleguide_rule` with the changed fields.

### Remove an outdated rule

```
We no longer use title case anywhere. Delete the "title case headings"
rule from our Ditto style guide.
```

The agent calls `get_styleguide_rules` to find the rule ID, then calls `delete_styleguide_rule`.
