Open Context Protocol is live! 🚀 Read the launch post

orgsListForUser

List organizations for a user

Details

  • Method: GET
  • Path: /users/{username}/orgs
  • Operation ID: orgs/list-for-user

Parameters

{
  "username": {
    "description": "The handle for the GitHub user account.",
    "required": true,
    "location": "path",
    "type": "string"
  },
  "per_page": {
    "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "page": {
    "description": "The page number of the results to fetch. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"",
    "required": false,
    "location": "query",
    "type": "integer"
  }
}

Response Schema

{
  "type": "array",
  "items": {
    "title": "Organization Simple",
    "description": "A GitHub organization.",
    "type": "object",
    "properties": {
      "login": {
        "type": "string",
        "example": "github"
      },
      "id": {
        "type": "integer",
        "example": 1
      },
      "node_id": {
        "type": "string",
        "example": "MDEyOk9yZ2FuaXphdGlvbjE="
      },
      "url": {
        "type": "string",
        "format": "uri",
        "example": "https://api.github.com/orgs/github"
      },
      "repos_url": {
        "type": "string",
        "format": "uri",
        "example": "https://api.github.com/orgs/github/repos"
      },
      "events_url": {
        "type": "string",
        "format": "uri",
        "example": "https://api.github.com/orgs/github/events"
      },
      "hooks_url": {
        "type": "string",
        "example": "https://api.github.com/orgs/github/hooks"
      },
      "issues_url": {
        "type": "string",
        "example": "https://api.github.com/orgs/github/issues"
      },
      "members_url": {
        "type": "string",
        "example": "https://api.github.com/orgs/github/members{/member}"
      },
      "public_members_url": {
        "type": "string",
        "example": "https://api.github.com/orgs/github/public_members{/member}"
      },
      "avatar_url": {
        "type": "string",
        "example": "https://github.com/images/error/octocat_happy.gif"
      },
      "description": {
        "type": "string",
        "example": "A great organization",
        "nullable": true
      }
    },
    "required": [
      "login",
      "url",
      "id",
      "node_id",
      "repos_url",
      "events_url",
      "hooks_url",
      "issues_url",
      "members_url",
      "public_members_url",
      "avatar_url",
      "description"
    ]
  }
}

Usage

from ocp_agent import OCPAgent

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

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