From ddd4cc76a32ec16796714c4741bd4ab495b5cb55 Mon Sep 17 00:00:00 2001 From: gsharini Date: Thu, 23 Oct 2025 08:56:12 +0000 Subject: [PATCH 1/2] Support Autonomous Recovery Service APIs --- src/oci-api-mcp-server/oracle/oci_api_mcp_server/server.py | 7 +++++++ 1 file changed, 7 insertions(+) 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..b110811 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 @@ -88,6 +88,13 @@ def get_oci_command_help(command: str) -> str: 1. compute instance list 2. compute instance 3. compute + + There are some services that have different command structure. In such cases, + you may need to experiment with the level of specificity to get the help you + need. + Listing resources in Autonomous Recovery Service is as below: + oci recovery protected-database-collection list-protected-databases + oci recovery protection-policy-collection list-protection-policies """ logger.info(f"get_oci_command_help called with command: {command}") env_copy = os.environ.copy() From 94295c048efba40c093441e05599d98e040648fd Mon Sep 17 00:00:00 2001 From: gsharini Date: Tue, 28 Oct 2025 05:11:02 +0000 Subject: [PATCH 2/2] Generalisation of oci command structure --- .../oracle/oci_api_mcp_server/server.py | 61 +++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) 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 b110811..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,32 +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 - - There are some services that have different command structure. In such cases, - you may need to experiment with the level of specificity to get the help you - need. - Listing resources in Autonomous Recovery Service is as below: - oci recovery protected-database-collection list-protected-databases - oci recovery protection-policy-collection list-protection-policies + 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()