Text Analysis

Get Initials

Extracts initials from full names with consistent formatting. Available via MCP in Cursor and other AI editors, or REST at GET /v1/text/initials. Input "John Michael Smith" returns "JMS". Handles edge cases like hyphens, apostrophes, and multiple middle names deterministically.

API Endpoint

GET /v1/text/initials

Code Examples

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

response = requests.get('https://tinyfn.io/v1/text/initials',
    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 text analysis tools:

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

Learn more about MCP setup →

FAQ

How does the initials extraction handle hyphenated names?

Takes the first letter of each word part. 'Mary-Jane Smith' becomes 'MJS', treating hyphenated first names as separate words.

What happens with names containing apostrophes or prefixes?

Ignores punctuation and common prefixes. 'O'Connor' gives 'O', 'de la Cruz' becomes 'DC', skipping lowercase articles.

Can I use this MCP tool to batch process customer names in my agent workflow?

Yes, call it iteratively through MCP in your AI editor. Each request processes one name, returning consistent single-letter initials.

Does it work with non-English names and special characters?

Handles Unicode characters correctly. 'José María González' returns 'JMG', preserving accented letters as initials.

What's the output format for single names or empty input?

Single names return one initial ('Madonna' → 'M'). Empty or whitespace-only input returns empty string.

Try Get Initials Now

Get your free API key and start using Get Initials in seconds.

Get Free API Key