Research & Benchmarks Optimization AI Ads Analytics Why Madgicx? About Us Blog Careers Case Studies Events Glossary Guides Answers Pricing Login Try for Free
MCP docs menu

Facebook Ads MCP whoiam Tool: Identity and Team

Tool for retrieving user identity and team information.

The whoiam tool retrieves information about the currently authenticated user and their connected Madgicx team.

Overview

Use Cases

Verify Connection

Confirm your MCP client is properly connected to Madgicx

Check Permissions

Review which OAuth scopes have been granted

Facebook Token Status

Verify your Facebook integration is active

Response

Parameter Type Description
user_id string Your unique Madgicx user identifier
team_id string The connected Madgicx team identifier
permissions string[] Array of granted OAuth scopes
facebook_token object Facebook token status information

Facebook Token Object

Parameter Type Description
status "active" | "expiring" | "expired" Current token status
expires_at string ISO 8601 timestamp of token expiration

Example Response

{
  "user_id": "user_123abc",
  "team_id": "team_456def",
  "permissions": ["mcp:read", "mcp:write"],
  "facebook_token": {
    "status": "active",
    "expires_at": "2024-12-31T23:59:59Z"
  }
}

Usage Examples

Natural Language

Ask your AI assistant naturally:

What Madgicx team am I connected to?
Show me my user information
Is my Facebook connection active?

Direct Query

The AI will call the tool with:

{
  "tool": "whoiam",
  "arguments": {}
}

Error Handling

Unauthorized (401)
{
  "error": "unauthorized",
  "message": "Access token is invalid or expired"
}

Cause: Your OAuth token has expired or is invalid.

Solution: Reconnect the MCP client to obtain a new token.

Forbidden (403)
{
  "error": "forbidden",
  "message": "Missing required scope: mcp:read"
}

Cause: Your authorization doesn't include the required mcp:read scope.

Solution: Disconnect and reconnect, ensuring you approve all requested permissions.

Official Meta Business Partner

Connect your AI assistant to your ad accounts. The 7-day free trial includes both MCPs.

Sign in with your Madgicx login, add the server addresses and ask in plain words. Meta changes wait for your confirmation, and the Google Ads MCP only reads.

Try for Free ($0 Trial)
200,000+ advertisers
$10B+ annual ad spend visibility
4.6 / 5 on G2, from 220+ reviews