Determines if one array is a subset of another by checking that all elements in array1 exist in array2. Access via GET /v1/array/is-subset or through MCP in Cursor and other AI coding tools. Returns a boolean result — useful for permission checks, feature validation, or data filtering logic where you need precise subset verification rather than guessed comparisons.
curl "https://tinyfn.io/v1/array/is-subset" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/array/is-subset', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/array/is-subset',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's array tools:
{
"mcpServers": {
"tinyfn-array": {
"url": "https://tinyfn.io/mcp/array",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Each element in array1 must exist at least once in array2, but duplicates don't affect the result. [1,2,2] is a subset of [1,2,3] even though array2 has fewer 2's.
Works with strings, numbers, booleans, and null values. Mixed-type arrays are supported — [1, "hello", true] can be checked as a subset of [1, 2, "hello", true, null].
Yes, perfect for checking if a user's permissions array is a subset of required permissions. Your AI agent gets a definitive true/false instead of hallucinating permission logic.
No, element order is irrelevant. [3,1,2] is a subset of [1,2,3,4,5]. Only the presence of elements matters, not their position.
An empty array is always a subset of any array. Arrays containing undefined values are handled correctly — undefined must exist in both arrays for subset validation.