{
  "service": "codegen",
  "displayName": "Codegen",
  "categories": [
    "Developer Tools",
    "AI"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "API Token",
      "placeholder": "CODEGEN_API_TOKEN",
      "description": "Codegen API token sent as a Bearer token. Generate it from the Codegen developer settings page: https://codegen.com/token.",
      "extraFields": [
        {
          "key": "organizationId",
          "label": "Organization ID",
          "inputType": "text",
          "required": true,
          "secret": false,
          "placeholder": "123",
          "description": "Numeric Codegen organization ID used for organization-scoped endpoints. Find it with your API token in Codegen developer settings: https://codegen.com/token."
        }
      ]
    }
  ],
  "homepageUrl": "https://codegen.com",
  "actions": [
    {
      "id": "codegen.get_agent_run",
      "service": "codegen",
      "name": "get_agent_run",
      "description": "Retrieve a single Codegen agent run status and result.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "org_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The Codegen organization ID. Omit this field to use the organization ID saved with the credential."
          },
          "agent_run_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The Codegen agent run ID to retrieve."
          }
        },
        "additionalProperties": false,
        "required": [
          "agent_run_id"
        ],
        "description": "Input parameters for retrieving one Codegen agent run."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "agent_run": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Codegen agent run ID."
              },
              "organization_id": {
                "type": "integer",
                "description": "The Codegen organization ID that owns the agent run."
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The current agent run status."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "created_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The timestamp when the agent run was created."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "web_url": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The Codegen web URL for the agent run.",
                    "format": "uri"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "result": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The final agent run result when available."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "summary": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The agent run summary when available."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "source_type": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "LOCAL",
                      "SLACK",
                      "GITHUB",
                      "GITHUB_CHECK_SUITE",
                      "GITHUB_PR_REVIEW",
                      "LINEAR",
                      "API",
                      "CHAT",
                      "JIRA",
                      "CLICKUP",
                      "MONDAY",
                      "SETUP_COMMANDS"
                    ],
                    "description": "The source type used to filter agent runs."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "github_pull_requests": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "The Codegen pull request record ID."
                        },
                        "title": {
                          "anyOf": [
                            {
                              "type": "string",
                              "description": "The pull request title."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "description": "The pull request URL.",
                              "format": "uri"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "description": "The timestamp when the pull request record was created."
                        },
                        "head_branch_name": {
                          "anyOf": [
                            {
                              "type": "string",
                              "description": "The pull request head branch name."
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": true,
                      "description": "A GitHub pull request linked to an agent run."
                    },
                    "description": "GitHub pull requests linked to the agent run."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "metadata": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": true,
                    "description": "Additional Codegen metadata for the agent run."
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": true,
            "description": "A Codegen agent run."
          }
        },
        "additionalProperties": false,
        "required": [
          "agent_run"
        ],
        "description": "The Codegen agent run response."
      }
    },
    {
      "id": "codegen.get_current_user",
      "service": "codegen",
      "name": "get_current_user",
      "description": "Retrieve the Codegen user associated with the API token.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "Input parameters for retrieving the current Codegen user."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Codegen user ID."
              },
              "email": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The user's email address.",
                    "format": "email"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "github_user_id": {
                "type": "string",
                "description": "The user's GitHub user ID."
              },
              "github_username": {
                "type": "string",
                "description": "The user's GitHub username."
              },
              "avatar_url": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The URL of the user's avatar image.",
                    "format": "uri"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "full_name": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The user's full name."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "role": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "The user's organization role."
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_admin": {
                "anyOf": [
                  {
                    "type": "boolean",
                    "description": "Whether the user is an admin."
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": true,
            "description": "A Codegen user."
          }
        },
        "additionalProperties": false,
        "required": [
          "user"
        ],
        "description": "The current Codegen user response."
      }
    },
    {
      "id": "codegen.list_agent_runs",
      "service": "codegen",
      "name": "list_agent_runs",
      "description": "List Codegen agent runs for an organization.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "org_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The Codegen organization ID. Omit this field to use the organization ID saved with the credential."
          },
          "user_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "description": "Filter agent runs by the Codegen user ID that started them."
              },
              {
                "type": "null"
              }
            ]
          },
          "source_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "LOCAL",
                  "SLACK",
                  "GITHUB",
                  "GITHUB_CHECK_SUITE",
                  "GITHUB_PR_REVIEW",
                  "LINEAR",
                  "API",
                  "CHAT",
                  "JIRA",
                  "CLICKUP",
                  "MONDAY",
                  "SETUP_COMMANDS"
                ],
                "description": "The source type used to filter agent runs."
              },
              {
                "type": "null"
              }
            ]
          },
          "skip": {
            "type": "integer",
            "minimum": 0,
            "description": "The number of items to skip before returning results."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "The maximum number of items to return. Codegen allows 1 to 100."
          }
        },
        "additionalProperties": false,
        "description": "Input parameters for listing Codegen agent runs."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "agent_runs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The Codegen agent run ID."
                },
                "organization_id": {
                  "type": "integer",
                  "description": "The Codegen organization ID that owns the agent run."
                },
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The current agent run status."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The timestamp when the agent run was created."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "web_url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The Codegen web URL for the agent run.",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "result": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The final agent run result when available."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "summary": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The agent run summary when available."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "source_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "LOCAL",
                        "SLACK",
                        "GITHUB",
                        "GITHUB_CHECK_SUITE",
                        "GITHUB_PR_REVIEW",
                        "LINEAR",
                        "API",
                        "CHAT",
                        "JIRA",
                        "CLICKUP",
                        "MONDAY",
                        "SETUP_COMMANDS"
                      ],
                      "description": "The source type used to filter agent runs."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "github_pull_requests": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "The Codegen pull request record ID."
                          },
                          "title": {
                            "anyOf": [
                              {
                                "type": "string",
                                "description": "The pull request title."
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "url": {
                            "anyOf": [
                              {
                                "type": "string",
                                "description": "The pull request URL.",
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "description": "The timestamp when the pull request record was created."
                          },
                          "head_branch_name": {
                            "anyOf": [
                              {
                                "type": "string",
                                "description": "The pull request head branch name."
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": true,
                        "description": "A GitHub pull request linked to an agent run."
                      },
                      "description": "GitHub pull requests linked to the agent run."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "metadata": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {},
                      "additionalProperties": true,
                      "description": "Additional Codegen metadata for the agent run."
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": true,
              "description": "A Codegen agent run."
            },
            "description": "Agent runs returned by Codegen."
          },
          "pagination": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "The total number of matching records."
              },
              "page": {
                "type": "integer",
                "description": "The current result page."
              },
              "size": {
                "type": "integer",
                "description": "The number of items in the page."
              },
              "pages": {
                "type": "integer",
                "description": "The total number of pages."
              }
            },
            "additionalProperties": false,
            "required": [
              "total",
              "page",
              "size",
              "pages"
            ],
            "description": "Pagination metadata returned by Codegen."
          }
        },
        "additionalProperties": false,
        "required": [
          "agent_runs",
          "pagination"
        ],
        "description": "The Codegen agent runs list response."
      }
    },
    {
      "id": "codegen.list_organizations",
      "service": "codegen",
      "name": "list_organizations",
      "description": "List Codegen organizations available to the authenticated API token.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "skip": {
            "type": "integer",
            "minimum": 0,
            "description": "The number of items to skip before returning results."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "The maximum number of items to return. Codegen allows 1 to 100."
          }
        },
        "additionalProperties": false,
        "description": "Input parameters for listing Codegen organizations."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "organizations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The Codegen organization ID."
                },
                "name": {
                  "type": "string",
                  "description": "The organization name."
                },
                "settings": {
                  "type": "object",
                  "properties": {
                    "enable_pr_creation": {
                      "type": "boolean",
                      "description": "Whether Codegen can create pull requests for this organization."
                    },
                    "enable_rules_detection": {
                      "type": "boolean",
                      "description": "Whether Codegen can detect rules for this organization."
                    }
                  },
                  "additionalProperties": true,
                  "description": "The organization settings returned by Codegen."
                }
              },
              "additionalProperties": true,
              "description": "A Codegen organization."
            },
            "description": "Organizations returned by Codegen."
          },
          "pagination": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "The total number of matching records."
              },
              "page": {
                "type": "integer",
                "description": "The current result page."
              },
              "size": {
                "type": "integer",
                "description": "The number of items in the page."
              },
              "pages": {
                "type": "integer",
                "description": "The total number of pages."
              }
            },
            "additionalProperties": false,
            "required": [
              "total",
              "page",
              "size",
              "pages"
            ],
            "description": "Pagination metadata returned by Codegen."
          }
        },
        "additionalProperties": false,
        "required": [
          "organizations",
          "pagination"
        ],
        "description": "The Codegen organizations list response."
      }
    },
    {
      "id": "codegen.list_repositories",
      "service": "codegen",
      "name": "list_repositories",
      "description": "List repositories for a Codegen organization.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "org_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The Codegen organization ID. Omit this field to use the organization ID saved with the credential."
          },
          "skip": {
            "type": "integer",
            "minimum": 0,
            "description": "The number of items to skip before returning results."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "The maximum number of items to return. Codegen allows 1 to 100."
          }
        },
        "additionalProperties": false,
        "description": "Input parameters for listing Codegen repositories."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "repositories": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "A Codegen repository."
            },
            "description": "Repositories returned by Codegen."
          },
          "pagination": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "The total number of matching records."
              },
              "page": {
                "type": "integer",
                "description": "The current result page."
              },
              "size": {
                "type": "integer",
                "description": "The number of items in the page."
              },
              "pages": {
                "type": "integer",
                "description": "The total number of pages."
              }
            },
            "additionalProperties": false,
            "required": [
              "total",
              "page",
              "size",
              "pages"
            ],
            "description": "Pagination metadata returned by Codegen."
          }
        },
        "additionalProperties": false,
        "required": [
          "repositories",
          "pagination"
        ],
        "description": "The Codegen repositories list response."
      }
    },
    {
      "id": "codegen.list_users",
      "service": "codegen",
      "name": "list_users",
      "description": "List users for a Codegen organization.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "org_id": {
            "type": "integer",
            "minimum": 1,
            "description": "The Codegen organization ID. Omit this field to use the organization ID saved with the credential."
          },
          "skip": {
            "type": "integer",
            "minimum": 0,
            "description": "The number of items to skip before returning results."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "The maximum number of items to return. Codegen allows 1 to 100."
          }
        },
        "additionalProperties": false,
        "description": "Input parameters for listing Codegen organization users."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The Codegen user ID."
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The user's email address.",
                      "format": "email"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "github_user_id": {
                  "type": "string",
                  "description": "The user's GitHub user ID."
                },
                "github_username": {
                  "type": "string",
                  "description": "The user's GitHub username."
                },
                "avatar_url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The URL of the user's avatar image.",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "full_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The user's full name."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "role": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "The user's organization role."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "is_admin": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "description": "Whether the user is an admin."
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": true,
              "description": "A Codegen user."
            },
            "description": "Users returned by Codegen."
          },
          "pagination": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "The total number of matching records."
              },
              "page": {
                "type": "integer",
                "description": "The current result page."
              },
              "size": {
                "type": "integer",
                "description": "The number of items in the page."
              },
              "pages": {
                "type": "integer",
                "description": "The total number of pages."
              }
            },
            "additionalProperties": false,
            "required": [
              "total",
              "page",
              "size",
              "pages"
            ],
            "description": "Pagination metadata returned by Codegen."
          }
        },
        "additionalProperties": false,
        "required": [
          "users",
          "pagination"
        ],
        "description": "The Codegen users list response."
      }
    }
  ]
}
