Open Context Protocol is live! 🚀 Read the launch post

usersIdentity

Get a user’s identity.

Details

  • Method: GET
  • Path: /users.identity
  • Operation ID: users_identity

Parameters

{
  "token": {
    "description": "Authentication token. Requires scope: `identity.basic`",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "description": "Schema for successful response from users.identity method",
  "items": [
    {
      "additionalProperties": false,
      "description": "Schema for 'identity.basic' scope",
      "properties": {
        "ok": {
          "enum": [
            true
          ],
          "title": "default success response",
          "type": "boolean"
        },
        "team": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "pattern": "^[T][A-Z0-9]{2,}$",
              "title": "Team ID",
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "type": "object"
        },
        "user": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "pattern": "^[UW][A-Z0-9]{2,}$",
              "title": "User ID",
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "id"
          ],
          "type": "object"
        }
      },
      "required": [
        "ok",
        "user",
        "team"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "description": "Schema for 'identity.basic,identity.email' scopes",
      "properties": {
        "ok": {
          "enum": [
            true
          ],
          "title": "default success response",
          "type": "boolean"
        },
        "team": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "pattern": "^[T][A-Z0-9]{2,}$",
              "title": "Team ID",
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "type": "object"
        },
        "user": {
          "additionalProperties": false,
          "properties": {
            "email": {
              "format": "email",
              "type": "string"
            },
            "id": {
              "pattern": "^[UW][A-Z0-9]{2,}$",
              "title": "User ID",
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "id",
            "email"
          ],
          "type": "object"
        }
      },
      "required": [
        "ok",
        "user",
        "team"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "description": "Schema for 'identity.basic,identity.avatar' scopes",
      "properties": {
        "ok": {
          "enum": [
            true
          ],
          "title": "default success response",
          "type": "boolean"
        },
        "team": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "pattern": "^[T][A-Z0-9]{2,}$",
              "title": "Team ID",
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "type": "object"
        },
        "user": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "pattern": "^[UW][A-Z0-9]{2,}$",
              "title": "User ID",
              "type": "string"
            },
            "image_192": {
              "format": "url",
              "type": "string"
            },
            "image_24": {
              "format": "url",
              "type": "string"
            },
            "image_32": {
              "format": "url",
              "type": "string"
            },
            "image_48": {
              "format": "url",
              "type": "string"
            },
            "image_512": {
              "format": "url",
              "type": "string"
            },
            "image_72": {
              "format": "url",
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "id",
            "image_24",
            "image_32",
            "image_48",
            "image_72",
            "image_192",
            "image_512"
          ],
          "type": "object"
        }
      },
      "required": [
        "ok",
        "user",
        "team"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "description": "Schema for 'identity.basic,identity.team' scopes",
      "properties": {
        "ok": {
          "enum": [
            true
          ],
          "title": "default success response",
          "type": "boolean"
        },
        "team": {
          "additionalProperties": false,
          "properties": {
            "domain": {
              "type": "string"
            },
            "id": {
              "pattern": "^[T][A-Z0-9]{2,}$",
              "title": "Team ID",
              "type": "string"
            },
            "image_102": {
              "format": "url",
              "type": "string"
            },
            "image_132": {
              "format": "url",
              "type": "string"
            },
            "image_230": {
              "format": "url",
              "type": "string"
            },
            "image_34": {
              "format": "url",
              "type": "string"
            },
            "image_44": {
              "format": "url",
              "type": "string"
            },
            "image_68": {
              "format": "url",
              "type": "string"
            },
            "image_88": {
              "format": "url",
              "type": "string"
            },
            "image_default": {
              "type": "boolean"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "name",
            "domain",
            "image_34",
            "image_44",
            "image_68",
            "image_88",
            "image_102",
            "image_132",
            "image_230",
            "image_default"
          ],
          "type": "object"
        },
        "user": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "pattern": "^[UW][A-Z0-9]{2,}$",
              "title": "User ID",
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "id"
          ],
          "type": "object"
        }
      },
      "required": [
        "ok",
        "user",
        "team"
      ],
      "type": "object"
    }
  ],
  "title": "users.identity schema"
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('slack')

# Call this tool
result = await agent.call_tool('usersIdentity', {
    # Add required parameters here
})