Mask Text selectively hides characters in strings while preserving specified start and end portions — essential for logging sensitive data or displaying partial credentials. Access via MCP in Cursor/Claude or REST at `/v1/text/mask`. For example, mask "secretpassword123" keeping 2 start + 2 end chars to show "se**********23". Deterministic masking ensures consistent output across calls.
curl "https://tinyfn.io/v1/text/mask" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/text/mask', {
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/mask',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Call the endpoint with your text and specify start=3, end=2 parameters. The middle portion gets replaced with asterisks or your chosen mask character.
If the text length is less than start + end characters, the entire string remains visible without masking to prevent data loss.
Yes, Claude Code and other MCP clients can call this tool to safely log or display partial sensitive information like API keys, passwords, or personal data.
By default uses asterisks (*) for masking. Check the API documentation for customization options like different mask characters or patterns.
Yes, the tool handles Unicode strings correctly, counting characters (not bytes) when determining start/end positions and applying masks.