> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sidenet.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Rebuild org tools

> Reloads the organization's custom tools and rebuilds every agent that uses them.



## OpenAPI

````yaml /api-reference/openapi.json post /rebuild-org-tools
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Sidenet HTTP endpoints exposed by the Sidenet Studio. All routes require an
    api key that can be generated through the studio in studio.sidenet.ai.
servers:
  - url: https://api.sidenet.ai
security:
  - bearerAuth: []
paths:
  /rebuild-org-tools:
    post:
      tags:
        - System
      summary: Rebuild org tools
      description: >-
        Reloads the organization's custom tools and rebuilds every agent that
        uses them.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                orgId:
                  type: string
                  description: Organization ID
                  example: 2b9d7c31-8e4f-4a2b-9d61-77c0a3f5e812
              additionalProperties: false
      responses:
        '200':
          description: >-
            The reload happened. A rebuild that failed for some agents is still
            a 200 — read `data.failed` and `data.tools.mcpErrors`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                    description: Human-readable summary of the same numbers.
                  data:
                    type: object
                    properties:
                      scope:
                        type: string
                        description: >-
                          Which slice of the registry was reloaded: `custom`,
                          `mcp` or `all`.
                      tools:
                        type: object
                        properties:
                          affectedToolIds:
                            type: array
                            items:
                              type: string
                          totalToolIds:
                            type: integer
                            description: Tools in the org after the reload.
                          providerCounts:
                            type: object
                            properties:
                              api:
                                type: integer
                              mcp:
                                type: integer
                              other:
                                type: integer
                          mcpErrors:
                            type: array
                            description: >-
                              MCP providers that failed to connect or list tools
                              during the reload. They contributed ZERO tools —
                              an empty array is the healthy case.
                            items:
                              type: object
                              properties:
                                providerId:
                                  type: string
                                providerName:
                                  type: string
                                error:
                                  type: string
                      rebuilt:
                        type: integer
                        description: Agents rebuilt successfully.
                      failed:
                        type: integer
                        description: Agents that failed to rebuild. Non-zero is a problem.
                      skipped:
                        type: integer
                      agents:
                        type: array
                        items:
                          type: object
                      failedAgents:
                        type: array
                        description: >-
                          Present when `failed` is non-zero: which agents, and
                          why.
                        items:
                          type: object
                          properties:
                            agentVersionId:
                              type: string
                              format: uuid
                            mastraId:
                              type: string
                            error:
                              type: string
                      totalBuildTime:
                        type: integer
                        description: Milliseconds spent rebuilding.
        '400':
          description: Bad request
        '403':
          description: Forbidden
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.

````