Checks whether a text string contains a specified substring, returning a boolean result. Use via MCP in Cursor or Windsurf for reliable string matching, or call GET /v1/string/contains with text and substring parameters. Example: checking if "hello world" contains "world" returns true. Case-sensitive by default, ensuring deterministic results across AI workflows.
curl "https://tinyfn.io/v1/string/contains" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/contains', {
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/contains',
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"
}
}
}
}
Call the contains tool with your text and substring parameters. It returns a boolean true/false result for exact matches.
Yes, matching is case-sensitive by default. 'Hello' and 'hello' are treated as different strings.
Yes, you can check if text contains '@' for basic email detection or 'http' for URLs, but use dedicated validation tools for robust checking.
Contains returns true/false for exact substring matches, while search functions typically return positions or extract matching patterns.
Provides the same functionality as Python's 'in' operator or JavaScript's includes(), but with consistent behavior across AI agents and guaranteed deterministic results.