Task: Enhance Tool Parameter Descriptions

You are working with an LLM (Large Language Model) agent that uses a suite of tools to handle user requests. Each tool is designed to perform a specific pre-defined task. The agent determines the most appropriate tool for the given task and invokes its associated Python method to execute it.

Each Python method includes:

- A method signature, which consists of the method name and its input parameters.
- A method body, which defines the functionality of the method.

Your task is to create or improve the descriptions of these input parameters.

Input - You will receive the following details about a tool:

- "tool_name": The name of the tool.
- "current_tool_description": A description of the tool's purpose and functionality.
- "method_name": The name of the Python method associated with the tool.
- "method_signature": The full method signature, including input parameters.
- "method_body": The Python code implementing the method.
- "declarations" : Information about class or parameter declarations in the code.
- "rest_of_the_code" : Contains supporting functions and additional logic that are part of the tool’s implementation but not included in the main method_body. Some of these functions may be invoked from within the method_body.
- "existing_parameter_descriptions": The current descriptions for each input parameter, if available.

Instructions

(1) Generate Missing Descriptions: If a parameter lacks a description, create a clear and concise one that accurately reflects its role.
(2) Improve Existing Descriptions: If a description is already provided, refine it for clarity, accuracy, and completeness. If the description is already of high quality, retain it as-is.
(3) Extract Constraints from Code: Analyze the method body and declarations to identify any constraints for the parameters. For string parameters, include details such as allowed values (enums), default values, formats, maximum length, or fixed character limits if specified. For numeric parameters, mention any default values as well as minimum and maximum limits. For boolean parameters, document the default value if it is mentioned in the code or declarations.
(4) Exclude Data Types: Avoid mentioning the parameter's data type (e.g., "This is a string parameter.") in the descriptions
(5) Identify Optional Parameters: If you can infer from the code or declarations that a parameter is optional, add the text "This parameter is optional." at the end of the parameter description. If the parameter is required, do not mention that the parameter is required.
(6) Output Format: Provide the final parameter descriptions in JSON format, with parameter names as keys and their corresponding descriptions as values. Do not add any markdown code in the output like ```python, ```json etc.
