Case Conversion Utilities

To Train Case

Converts text to Train-Case format where words are capitalized and joined with hyphens (like "Hello-World-Example"). Access via GET /v1/case/train or through MCP in Cursor, Claude Code, and other AI editors. Perfect for CSS class names, URL slugs, and consistent naming conventions. Returns deterministic output regardless of input spacing or punctuation.

API Endpoint

GET /v1/case/train

Code Examples

curl "https://tinyfn.io/v1/case/train" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/case/train', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/case/train',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's case conversion tools:

{
  "mcpServers": {
    "tinyfn-case": {
      "url": "https://tinyfn.io/mcp/case",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What is Train-Case and how does it differ from kebab-case?

Train-Case capitalizes each word and joins them with hyphens (Hello-World), while kebab-case uses lowercase words with hyphens (hello-world). Train-Case is also called Pascal-Kebab-Case.

How do I convert text to Train-Case using MCP in Cursor or Claude Code?

Use the to_train_case MCP tool with your text input. The AI agent will call TinyFn's deterministic converter and return the properly formatted Train-Case string.

What happens to special characters and numbers in Train-Case conversion?

Special characters are typically removed or replaced with hyphens, while numbers are preserved. Multiple spaces and punctuation collapse into single hyphens between capitalized words.

Can I use the REST API directly for Train-Case conversion?

Yes, make a GET request to /v1/case/train with your text as a query parameter. Returns JSON with the converted Train-Case string.

When should I use Train-Case over other naming conventions?

Train-Case works well for CSS class names that need readability, component names in some frameworks, or when you need kebab-case structure but with better visual separation through capitalization.

Try To Train Case Now

Get your free API key and start using To Train Case in seconds.

Get Free API Key