Your agent tries to extract all email addresses from a document by "thinking about" the regex pattern. Sometimes it works, sometimes it misses edge cases or returns false positives. These tools execute real regex patterns against actual text.
All Regex Tools (19)
Your agent gets access to 19 regex tools via the /mcp/regex/ endpoint. Here's the complete list:
| Tool | Description |
|---|---|
regex/test | Test Pattern |
regex/find-all | Find All Matches |
regex/replace | Regex Replace |
regex/split | Regex Split |
regex/validate | Validate Pattern |
regex/escape | Escape Pattern |
regex/groups | Extract Groups |
regex/pattern/email | Get Email Pattern |
regex/pattern/url | Get Url Pattern |
regex/pattern/phone | Get Phone Pattern |
regex/pattern/ipv4 | Get Ipv4 Pattern |
regex/pattern/ipv6 | Get Ipv6 Pattern |
regex/pattern/date | Get Date Pattern |
regex/pattern/time | Get Time Pattern |
regex/pattern/credit-card | Get Credit Card Pattern |
regex/pattern/uuid | Get Uuid Pattern |
regex/pattern/slug | Get Slug Pattern |
regex/pattern/hex-color | Get Hex Color Pattern |
regex/pattern/password | Get Password Pattern |
Agent Scenarios
Here's how real agents use these tools:
1. Data extraction agent
A scraping agent extracts all email addresses from a text block using a regex pattern.
regex/match
{ "text": "Contact us at info@example.com or support@example.com", "pattern": "[\\w.-]+@[\\w.-]+\\.\\w+" }
2. Log analysis agent
A monitoring agent extracts timestamps and error codes from log entries using regex patterns.
regex/extract
{ "text": "2026-02-15 ERROR [500] Connection failed", "pattern": "\\[(\\d+)\\]" }
3. Content cleanup agent
An editor agent replaces all phone number formats with a standardized format.
regex/replace
{ "text": "Call 555-1234 or (555) 567-8900", "pattern": "\\(?\\d{3}\\)?[-.\\s]?\\d{3}[-.\\s]?\\d{4}", "replacement": "[PHONE]" }
MCP Setup
Add regex tools to your agent in under 2 minutes. Choose your client:
Claude Desktop / Claude Code
Add this to your MCP config:
{
"mcpServers": {
"tinyfn-regex": {
"url": "https://api.tinyfn.io/mcp/regex/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
Cursor
Go to Settings > MCP and add a new server:
- Type: SSE
- URL:
https://api.tinyfn.io/mcp/regex/sse - Headers:
X-API-Key: your-api-key
Tip: Use the category-specific endpoint (/mcp/regex/) for the best experience. The all-in-one endpoint (/mcp/all/) works too but has 500+ tools which some clients handle less efficiently.
When to Use These Tools
Use regex MCP tools when your agent needs to:
- Guarantee correctness — when wrong answers have real consequences
- Process user data — when you're operating on actual user input, not hypothetical examples
- Maintain consistency — when the same input must always produce the same output
You don't need these tools for casual conversation or rough estimates. Use them when precision matters.
Ready to add regex tools to your agent?
Get Free API Key 100 requests/month free. No credit card required.Frequently Asked Questions
Can LLMs write regex patterns?
LLMs can often write correct regex patterns, but they can't execute them. The value of these tools is in the execution — actually running the pattern against text and returning real matches, not predicted ones.
What regex operations does TinyFn support?
TinyFn supports pattern matching (full match and find all), capturing group extraction, replacement, splitting by pattern, and pattern validation.
What regex flavor does TinyFn use?
TinyFn uses Python's re module, which supports a rich regex syntax including lookahead, lookbehind, named groups, and Unicode character classes.