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

# Update playbook tool message

> Replaces the message in a slot that already has one, with the full set of examples or the response to say instead. Switching between generative and scripted keeps the stored text of the form you switched away from, switched off.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json patch /v1/stable/playbook/{playbookID}/tool-message
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/playbook/{playbookID}/tool-message:
    patch:
      tags:
        - Playbook
      summary: Update playbook tool message
      description: Replaces the message in a slot that already has one, with the full
        set of examples or the response to say instead. Switching between
        generative and scripted keeps the stored text of the form you switched
        away from, switched off.
      operationId: StablePlaybookController_updateToolMessage
      parameters:
        - name: playbookID
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The ID of the playbook to operate on.
          description: The ID of the playbook to operate on.
        - name: projectID
          required: true
          in: query
          description: Addresses one message on one tool. Exactly one of toolID and
            nativeTool is required; sending neither or both is rejected.
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          description: Addresses one message on one tool. Exactly one of toolID and
            nativeTool is required; sending neither or both is rejected.
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
        - name: slot
          required: true
          in: query
          description: Addresses one message on one tool. Exactly one of toolID and
            nativeTool is required; sending neither or both is rejected.
          schema:
            $ref: "#/components/schemas/StableToolMessageSlot"
        - name: toolID
          required: false
          in: query
          description: Addresses one message on one tool. Exactly one of toolID and
            nativeTool is required; sending neither or both is rejected.
          schema:
            description: A tool attached to this agent or playbook. Cannot be used with
              nativeTool.
            type: string
            minLength: 1
        - name: nativeTool
          required: false
          in: query
          description: Addresses one message on one tool. Exactly one of toolID and
            nativeTool is required; sending neither or both is rejected.
          schema:
            allOf:
              - $ref: "#/components/schemas/StableNativeToolKey"
      requestBody:
        required: true
        description: A tool message in one of its two forms. Writing one form switches
          the slot to it and leaves the other form stored but inactive, exactly
          as the editor does — so switching back does not have to be retyped.
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableToolMessageRequest"
      responses:
        "200":
          description: Confirms the message was replaced and which form, generative or
            scripted, the slot is now in.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableTextUpdateResponse"
          x-vf-doc:
            description: Confirms the message was replaced and which form, generative or
              scripted, the slot is now in.
      security:
        - token: []
components:
  schemas:
    StableToolMessageSlot:
      type: string
      enum:
        - delay
        - failure
        - execution
        - completion
      description: Which of the tool's four messages to write. `execution` is said
        when the tool starts (the editor labels it Start), `completion` when it
        finishes (Complete), `failure` when it errors (Failed), `delay` when it
        is taking a while (Delayed).
      x-enumNames:
        - DELAY
        - FAILURE
        - EXECUTION
        - COMPLETION
    StableNativeToolKey:
      type: string
      enum:
        - endTool
        - cardTool
        - buttonTool
        - carouselTool
        - webSearchTool
        - callForwardTool
        - knowledgeBaseTool
      description: One of the built-in tools on this agent or playbook, under the same
        key it is read back at. skipTurnTool is absent because it carries no
        messages. The Voiceflow editor offers only the execution message on
        endTool, cardTool, buttonTool, carouselTool and callForwardTool;
        webSearchTool and knowledgeBaseTool offer all four. This API accepts any
        slot on any of them.
      x-enumNames:
        - END_TOOL
        - CARD_TOOL
        - BUTTON_TOOL
        - CAROUSEL_TOOL
        - WEB_SEARCH_TOOL
        - CALL_FORWARD_TOOL
        - KNOWLEDGE_BASE_TOOL
    StableToolMessageRequest:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - generative
              description: "Discriminator: the model writes this message itself, guided by the
                examples below."
              x-enumNames:
                - GENERATIVE
            examples:
              minItems: 1
              type: array
              items:
                $ref: "#/components/schemas/MarkdownLikeString"
              description: Example phrasings the model writes from. Replaces every example the
                slot holds today.
          required:
            - type
            - examples
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - scripted
              description: "Discriminator: this message is a fixed response, said verbatim."
              x-enumNames:
                - SCRIPTED
            messageID:
              type: string
              description: The ID of an existing response in this environment — the same ID
                this slot reports as <slot>MessageID on a read.
          required:
            - type
            - messageID
          additionalProperties: false
      description: A tool message in one of its two forms. Writing one form switches
        the slot to it and leaves the other form stored but inactive, exactly as
        the editor does — so switching back does not have to be retyped.
    MarkdownLikeString:
      type: string
      description: "Message text shown to the end user. Limited markdown: **bold**,
        _italic_, <u>underline</u>, ~~strikethrough~~, [label](url).
        {variable_name} inserts a variable or entity, {variable_name.path} a
        field of a variable. Escape a literal { or \\ with a backslash. A name
        matching neither is stored as literal text and reported in
        unresolvedReferences; secrets are not available here."
    StableTextUpdateResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message confirming the update.
        unresolvedReferences:
          description: References this write kept as literal text instead of binding, each
            with the reason. The write still succeeded.
          type: array
          items:
            $ref: "#/components/schemas/StableUnresolvedReference"
      required:
        - message
    StableUnresolvedReference:
      type: object
      properties:
        path:
          type: string
          description: Dotted path of the field that carried it, e.g.
            `knowledgeBaseTool.filters[0].defaultValue`.
        token:
          type: string
          description: The reference as written, without braces.
        reason:
          type: string
          enum:
            - unknown
            - secret-not-allowed
            - path-on-non-variable
            - resource-id
            - invalid-name
            - dangling
          description: "`unknown`: no variable or entity of that name.
            `secret-not-allowed`: the name is a project secret and this field
            does not accept one. `path-on-non-variable`: only a variable has
            fields. `resource-id`: a bare resource id, not a name.
            `invalid-name`: outside the `^\\w{1,64}$` name grammar. `dangling`:
            the reference rendered as a bare id, because its row is gone or its
            name is outside the name grammar."
          x-enumNames:
            - UNKNOWN
            - SECRET_NOT_ALLOWED
            - PATH_ON_NON_VARIABLE
            - RESOURCE_ID
            - INVALID_NAME
            - DANGLING
      required:
        - path
        - token
        - reason
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
