Validates whether a string ends with a specific suffix pattern. Use via MCP in Cursor or Windsurf for text validation tasks, or call GET /v1/string/ends-with directly. Returns true/false for cases like checking file extensions (".jpg") or URL patterns ("/api"). Case-sensitive by default with optional ignore-case parameter.
curl "https://tinyfn.io/v1/string/ends-with" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/ends-with', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/string/ends-with',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's string tools:
{
"mcpServers": {
"tinyfn-string": {
"url": "https://tinyfn.io/mcp/string",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Pass the filename as the text parameter and ".pdf" as the suffix. The tool returns true if the filename ends exactly with those characters, false otherwise.
Yes, by default it's case-sensitive. "File.PDF" won't match suffix ".pdf". Most implementations include a case-insensitive option via query parameter.
Yes, MCP integration lets AI agents validate multiple files at once. Useful for filtering file lists or validating user uploads in development workflows.
Ends-with only matches the exact end of a string, while contains finds the pattern anywhere. Use ends-with for suffixes like extensions, contains for general text search.
Empty suffix returns true for any string. Special characters like spaces, dots, and Unicode work normally—just ensure proper URL encoding for REST API calls.