diff --git a/src/oci-api-mcp-server/oracle/oci_api_mcp_server/server.py b/src/oci-api-mcp-server/oracle/oci_api_mcp_server/server.py index 1a8e59e..2f25de4 100644 --- a/src/oci-api-mcp-server/oracle/oci_api_mcp_server/server.py +++ b/src/oci-api-mcp-server/oracle/oci_api_mcp_server/server.py @@ -69,25 +69,43 @@ def get_oci_commands() -> str: @mcp.tool def get_oci_command_help(command: str) -> str: """Returns helpful instructions for running an OCI CLI command. - Only provide the command after 'oci', do not include the string 'oci' - in your command. - Never use the information returned by this tool to tell a user what - to do, only use it to help you determine which command to run yourself - using the run_oci_command tool. - - CLI commands are structured as ; you can get - help at the service level, resource level or action level, respectively: - 1. compute - 2. compute instance - 3. compute instance list - - If your request for help for a specific command - returns an error, make your requests successively less specific; - example: - 1. compute instance list - 2. compute instance - 3. compute + IMPORTANT: + - Only provide the command _after_ 'oci' — do not include the string + 'oci' in `command`. + - Never use the information returned by this tool to instruct an end + user directly. Use it only to determine which command to run + yourself using run_oci_command. + + Command structure guidance: + - OCI subcommands are organized as: + ... + e.g. + compute instance list OR + compute instance action-name OR + recovery protected-database-collection list-protected-databases + - Services vary in how they structure their CLI. Some use + explicit resource tokens (compute instance list), others use + collection names or hyphenated actions + (e.g. list-protected-databases), + and some have deeper subcommand chains (service sub1 sub2 sub3 ...). + + How to ask for help: + - Start with the most specific form you think is correct, for example: + compute instance list + compute instance action-name + recovery protected-database-collection list-protected-databases + - If the specific request returns an error, progressively make it + less specific: + 1. try the full command (most specific) + 2. remove the final token and try again + 3. repeat until you reach just the service name (e.g. compute) + - Additionally, if a service commonly uses hyphenated commands for + list operations, try hyphenated forms as well + e.g. + recovery protected-database list-protected-databases OR + psql db-system-collection list-db-systems. + """ logger.info(f"get_oci_command_help called with command: {command}") env_copy = os.environ.copy()