Custom tool save prompt error:invalid schema:cannot access local variable'parameter'whereitisnot associatedwithavalue #7626

Closed
opened 2026-02-21 18:21:33 -05:00 by yindo · 2 comments
Owner

Originally created by @leftchest on GitHub (Jan 9, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The previous custom tool can be used normally, but any modifications cannot be saved, prompting:invalid schema:cannot access local variable'parameter'whereitisnot associatedwithavalue
微信图片_20250109202000

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @leftchest on GitHub (Jan 9, 2025). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The previous custom tool can be used normally, but any modifications cannot be saved, prompting:invalid schema:cannot access local variable'parameter'whereitisnot associatedwithavalue ![微信图片_20250109202000](https://github.com/user-attachments/assets/ad7ad81e-822b-4ee0-b836-7a36ed961807) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:21:33 -05:00
yindo closed this issue 2026-02-21 18:21:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 9, 2025):

Hello, @leftchest! I'm here to assist you with any bugs, questions, or contributions. Let's work together to tackle this issue.

To resolve the "invalid schema: cannot access local variable 'parameter' where it is not associated with a value" error in Dify version 0.15, ensure that your OpenAPI schema is correctly structured. This error might be due to an incorrect or incomplete schema definition. Here's a corrected version of the schema:

openapi: 3.0.0
info:
  title: fake title
  description: API for creating recommended actions
  version: 1.0.0
servers:
  - url: https://abc.com
paths:
  /recommended_actions:
    post:
      summary: a summary
      description: a description
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                actions:
                  type: array
                  items: 
                    type: string
                  description: Description of actions
                tts:
                  type: string
                  description: Description of tts
      responses:
        '200':
          description: Successfully processed request

Make sure all required fields and descriptions are properly filled out and that the schema adheres to the OpenAPI 3.0.0 specification. If the issue persists, you might want to refer to the official documentation for further guidance [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Jan 9, 2025): <!-- Greeting --> Hello, @leftchest! I'm here to assist you with any bugs, questions, or contributions. Let's work together to tackle this issue. <!-- Answer --> To resolve the "invalid schema: cannot access local variable 'parameter' where it is not associated with a value" error in Dify version 0.15, ensure that your OpenAPI schema is correctly structured. This error might be due to an incorrect or incomplete schema definition. Here's a corrected version of the schema: ```yaml openapi: 3.0.0 info: title: fake title description: API for creating recommended actions version: 1.0.0 servers: - url: https://abc.com paths: /recommended_actions: post: summary: a summary description: a description requestBody: required: true content: application/json: schema: type: object properties: actions: type: array items: type: string description: Description of actions tts: type: string description: Description of tts responses: '200': description: Successfully processed request ``` Make sure all required fields and descriptions are properly filled out and that the schema adheres to the OpenAPI 3.0.0 specification. If the issue persists, you might want to refer to the official documentation for further guidance <sup>[[1]](https://github.com/langgenius/dify/issues/12456)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/ef2c022c-71e7-477c-8c49-ae224c884e96?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/ef2c022c-71e7-477c-8c49-ae224c884e96?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/ef2c022c-71e7-477c-8c49-ae224c884e96?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/ef2c022c-71e7-477c-8c49-ae224c884e96?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ef2c022c-71e7-477c-8c49-ae224c884e96?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/ef2c022c-71e7-477c-8c49-ae224c884e96?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Jan 9, 2025):

Duplicated https://github.com/langgenius/dify/issues/12518

@crazywoola commented on GitHub (Jan 9, 2025): Duplicated https://github.com/langgenius/dify/issues/12518
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7626