Open Context Protocol is live! 🚀 Read the launch post
usersListGpgKeysForUser

usersListGpgKeysForUser

List GPG keys for a user

Details

  • Method: GET
  • Path: /users/{username}/gpg_keys
  • Operation ID: users/list-gpg-keys-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": "GPG Key",
    "description": "A unique encryption key",
    "type": "object",
    "properties": {
      "id": {
        "type": "integer",
        "format": "int64",
        "example": 3
      },
      "name": {
        "type": "string",
        "example": "Octocat's GPG Key",
        "nullable": true
      },
      "primary_key_id": {
        "type": "integer",
        "nullable": true
      },
      "key_id": {
        "type": "string",
        "example": "3262EFF25BA0D270"
      },
      "public_key": {
        "type": "string",
        "example": "xsBNBFayYZ..."
      },
      "emails": {
        "type": "array",
        "example": [
          {
            "email": "octocat@users.noreply.github.com",
            "verified": true
          }
        ],
        "items": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "verified": {
              "type": "boolean"
            }
          }
        }
      },
      "subkeys": {
        "type": "array",
        "example": [
          {
            "id": 4,
            "primary_key_id": 3,
            "key_id": "4A595D4C72EE49C7",
            "public_key": "zsBNBFayYZ...",
            "emails": [],
            "can_sign": false,
            "can_encrypt_comms": true,
            "can_encrypt_storage": true,
            "can_certify": false,
            "created_at": "2016-03-24T11:31:04-06:00",
            "expires_at": null,
            "revoked": false
          }
        ],
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "format": "int64"
            },
            "primary_key_id": {
              "type": "integer"
            },
            "key_id": {
              "type": "string"
            },
            "public_key": {
              "type": "string"
            },
            "emails": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "verified": {
                    "type": "boolean"
                  }
                }
              }
            },
            "subkeys": {
              "type": "array",
              "items": {}
            },
            "can_sign": {
              "type": "boolean"
            },
            "can_encrypt_comms": {
              "type": "boolean"
            },
            "can_encrypt_storage": {
              "type": "boolean"
            },
            "can_certify": {
              "type": "boolean"
            },
            "created_at": {
              "type": "string"
            },
            "expires_at": {
              "type": "string",
              "nullable": true
            },
            "raw_key": {
              "type": "string",
              "nullable": true
            },
            "revoked": {
              "type": "boolean"
            }
          }
        }
      },
      "can_sign": {
        "type": "boolean",
        "example": true
      },
      "can_encrypt_comms": {
        "type": "boolean"
      },
      "can_encrypt_storage": {
        "type": "boolean"
      },
      "can_certify": {
        "type": "boolean",
        "example": true
      },
      "created_at": {
        "type": "string",
        "format": "date-time",
        "example": "2016-03-24T11:31:04-06:00"
      },
      "expires_at": {
        "type": "string",
        "format": "date-time",
        "nullable": true
      },
      "revoked": {
        "type": "boolean",
        "example": true
      },
      "raw_key": {
        "type": "string",
        "nullable": true
      }
    },
    "required": [
      "id",
      "primary_key_id",
      "key_id",
      "raw_key",
      "public_key",
      "created_at",
      "expires_at",
      "can_sign",
      "can_encrypt_comms",
      "can_encrypt_storage",
      "can_certify",
      "emails",
      "subkeys",
      "revoked"
    ]
  }
}

Usage

from ocp_agent import OCPAgent

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

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