MMetadata /docs
Docs/Tools/list_user_accounts

list_user_accounts

List accounts the current user has access to, with optional name filtering.

Read account

Returns data. Calling it changes nothing, so it is safe in an unattended loop.

What it does

List accounts the current user has access to, with optional name filtering.

                                USE FOR: "which accounts do I have access to?", "show me my accounts", "what accounts can I manage?", "what is my account ID?", "which account am I logged into?", "what role do I have?", "show me account named X", "do you have an account called X?"

                                AUTH METHODS: JWT tokens (OAuth) | PAT tokens (prefix "pat-")

                                ARGS:
                                - name (optional for regular users, REQUIRED for super users): partial account name to search for. Super users span the whole platform and would otherwise return an unbounded list, so the search term is mandatory for them. If a super user calls this without `name`, the tool returns an error asking for one — re-call with the user's intended search term.

                                RESPONSE FORMAT (identical for JWT and PAT — the token format does not change the result):
                                Regular users: user_id, email, default_account_id, is_super_user, token_type, accounts[{account_id, name, role}]
                                Super users without name: error response — supply `name` and retry.
                                Super users with name: matching accounts platform-wide (paged at 20).

Arguments

ArgumentTypeNotes
name string Partial account name to search for. Optional for regular users (acts as a filter); required for super users (acts as the search query against the whole platform).

Request

curl
curl -s -X POST https://mcp-server.metadata.io/mcp \
  -H "Authorization: $METADATA_PAT" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_user_accounts","arguments":{}}}'

Response

Real, from the production server, in 906 ms. Values that identify a customer or disclose money are replaced with typed placeholders; keys, types and nesting are exactly as returned.

recorded response
{
 "error": "[error redacted]",
 "user_id": 6,
 "email": "[email redacted]",
 "is_super_user": true,
 "token_type": "PAT"
}

Other account tools:

All 160 tools · machine-readable index