Quick text prefix validation via GET /v1/string/starts-with or MCP in Cursor and other AI editors. Returns boolean true/false for whether a string begins with the specified prefix. Case-sensitive by default, with optional case-insensitive matching. Essential for URL routing, file type detection, and parsing workflows where AI agents need deterministic string matching.
curl "https://tinyfn.io/v1/string/starts-with" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/starts-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/starts-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"
}
}
}
}
Send a GET request to /v1/string/starts-with with 'text' and 'prefix' parameters. Returns {"result": true} if the string starts with the prefix, {"result": false} otherwise.
Yes, by default it's case-sensitive. 'Hello' starts with 'H' but not 'h'. Most implementations offer a case-insensitive option via an additional parameter.
Absolutely. AI agents can check if file paths start with specific directories, validate URL schemes, or filter lists based on prefixes without hallucinating the matching logic.
An empty string doesn't start with any non-empty prefix (returns false). Every string starts with an empty prefix (returns true). Edge case handling is deterministic.
Starts-with only checks the beginning of the string, making it faster than full string searches. More predictable than regex for simple prefix validation in AI workflows.