Skip to content

Conversation

@mayurkhandave
Copy link
Member

@mayurkhandave mayurkhandave commented Oct 15, 2025

Description

Integrating Limits MCP server to support fetching limit value and usage

Fixes # 34

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Unit tests
  • Integrated locally with cline and tested following prompts
    • what is my usage for standard-e2-core-count for ocid1.tenancy.oc1..xyz
    • list all limit services

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Oct 15, 2025
subscription_id: Annotated[Optional[str], "Subscription OCID filter"] = None,
) -> list[dict]:
"""
Maps to GET /20190729/services/{serviceName}/limits/{limitName}/resourceAvailability
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @mcp.tool description will overwrite this btw

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More like a comment

mayurkhandave and others added 9 commits October 20, 2025 09:11
Signed-off-by: Mayur Khandave <mayur.khandave@oracle.com>
Signed-off-by: Mayur Khandave <mayur.khandave@oracle.com>
Signed-off-by: Mayur Khandave <mayur.khandave@oracle.com>
Signed-off-by: Richard Gebhardt <richard.gebhardt@oracle.com>
Signed-off-by: Mayur Khandave <mayur.khandave@oracle.com>
Signed-off-by: Mayur Khandave <mayur.khandave@oracle.com>
Signed-off-by: Mayur Khandave <mayur.khandave@oracle.com>
Signed-off-by: Mayur Khandave <mayur.khandave@oracle.com>
Signed-off-by: will.shope <will.shope@oracle.com>
@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Oct 20, 2025
"fastmcp==2.12.2",
"oci==2.160.0"
]

Copy link
Member

@gebhardtr gebhardtr Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add an authors attribute? feel free to use our project address: https://github.com/oracle/mcp/blob/main/src/oci-api-mcp-server/pyproject.toml#L9-L11; we'll create issues and assign them if ppl contact us.

Other than that, LGTM.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

return oci.limits.LimitsClient(config, signer=signer)


def get_identity_client():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be getting identity client here? I think we would want to leave the calls for this to the identity server, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried approach of letting cline decide if call to availability domain is needed and then figure out calling identity mcp

but it was very slow and most of the time it was not able to find it



# ----------------------------
# Mappers to stable dict shapes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put these mappers into a models.py file? Check the standards we're laying out in this PR
#43

@mcp.tool(
description="List availability domains for a given compartment needed for limits"
)
def provide_availability_domains_for_limits(
Copy link
Member

@shopewf shopewf Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already a tool in our identity server, if it needs to be used Id rather have some other annotation that tells another tool that it would need to consume the list_availabilty_domains tool in some cases

)
def list_services(
compartment_id: Annotated[str, "OCID of the root compartment (tenancy)"],
sort_by: Annotated[str, "Sort field: name or description"] = "name",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check best practices PR to see how best to annotate and define optional parameters
#43

@mcp.tool(
description="Get the full list of resource limit values for the given service"
)
def get_limit_value(
Copy link
Member

@shopewf shopewf Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name should be list_limit_values rather than get_limit_value, no? Name is super important for LLMs to determine which tool to call

"""
try:
client = get_limits_client()
items = list_limit_values_with_pagination(
Copy link
Member

@shopewf shopewf Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this same thing in some of my earlier PRs where I split things up into a utils function, but we decided as a team to try and keep relevant code near each other. Could we just take the contents of this help file and stick them here?

Edit: I see this function gets reused below, hmmm....

@gebhardtr
Copy link
Member

Closes #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants