Formatting Utilities

Format List

Format List transforms arrays into grammatically correct text with proper conjunctions and punctuation. Access via GET /v1/format/list or through MCP in Cursor and other AI editors. Pass ["apple", "banana", "cherry"] and get "apple, banana, and cherry" with Oxford comma support. Handles edge cases like single items and empty arrays deterministically.

API Endpoint

GET /v1/format/list

Code Examples

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

response = requests.get('https://tinyfn.io/v1/format/list',
    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 formatting tools:

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

Learn more about MCP setup →

FAQ

How do I format a list with proper grammar using MCP?

Call the format_list tool with your array of items. It automatically adds commas, conjunctions, and handles Oxford comma rules for proper English grammar.

What happens when I format a list with only one or two items?

Single items return as-is without commas. Two items get joined with 'and' (no comma). Three or more items get full comma separation with Oxford comma.

Can I customize the conjunction word in list formatting?

The tool uses 'and' as the default conjunction. Check the API documentation for parameters that might allow custom conjunctions like 'or'.

Does the format list tool handle empty arrays or null values?

Empty arrays typically return empty strings or appropriate null responses. The deterministic behavior ensures consistent handling of edge cases.

When should I use format list instead of simple array join?

Use format list when you need proper English grammar for user-facing text. Simple joins lack Oxford commas and proper conjunction placement for readability.

Try Format List Now

Get your free API key and start using Format List in seconds.

Get Free API Key