Skip to main content
Glama
nacos-group

Nacos MCP Server

Official
by nacos-group

get_service

Retrieve detailed service information including metadata and clusters from Nacos service discovery, without instance lists.

Instructions

This interface retrieves detailed information of a specified service, including metadata and clusters, not including instance list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNoThe namespaceId of services, default is `public` if missing
groupNameNoThe groupName pattern of services, default is `DEFAULT_GROUP` if missing
serviceNameYesThe serviceName pattern of services, required.

Implementation Reference

  • Core implementation of the 'get_service' tool via the NacosGetService class, which defines the tool name, input schema, description, and the specific Nacos API endpoint URL for retrieving service details.
    class NacosGetService(NacosTool):
        def __init__(self):
            super().__init__(
                name=NacosToolNames.GET_SERVICE,
                description="This interface retrieves detailed information of a specified service, including metadata and clusters, not including instance list.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "namespaceId": {"type": "string",
                                        "description": "The namespaceId of services, default is `public` if missing"},
                        "groupName": {"type": "string",
                                      "description": "The groupName pattern of services, default is `DEFAULT_GROUP` if missing"},
                        "serviceName": {"type": "string",
                                        "description": "The serviceName pattern of services, required."}
                    },
                    "required": ["serviceName"],
                },
                url="/nacos/v3/admin/ns/service"
            )
  • Registers the NacosGetService tool (get_service) among the list of available tools returned by the list_tools handler.
    return [
        nacos_tools.NacosListNamespacesTool(),
        nacos_tools.NacosListServices(),
        nacos_tools.NacosGetService(),
        nacos_tools.NacosListInstances(),
        nacos_tools.NacosListServiceSubscribers(),
        nacos_tools.NacosListConfigs(),
        nacos_tools.NacosGetConfig(),
        nacos_tools.NacosListConfigHistory(),
        nacos_tools.NacosGetConfigHistory(),
        nacos_tools.NacosListConfigListeners(),
        nacos_tools.NacosListListenedConfigs(),
    ]
  • Dispatch handler in call_tool function that executes the get_service tool by fetching its URL and invoking the shared Nacos GET request method with provided arguments.
    case nacos_tools.NacosToolNames.GET_SERVICE:
        url = nacos_tools.NacosGetService().url
        result = nacos.get(name, url, arguments)
        return [types.TextContent(type="text", text=result)]
  • Enum definition mapping GET_SERVICE to the tool name string 'get_service' used for registration and dispatch.
    GET_SERVICE = "get_service",
  • Input schema definition for the get_service tool, specifying parameters namespaceId, groupName, and required serviceName.
    inputSchema={
        "type": "object",
        "properties": {
            "namespaceId": {"type": "string",
                            "description": "The namespaceId of services, default is `public` if missing"},
            "groupName": {"type": "string",
                          "description": "The groupName pattern of services, default is `DEFAULT_GROUP` if missing"},
            "serviceName": {"type": "string",
                            "description": "The serviceName pattern of services, required."}
        },
        "required": ["serviceName"],
    },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adequately describes the read-only nature ('retrieves') and specifies the scope of returned data. However, it doesn't mention potential limitations like rate limits, authentication requirements, error conditions, or response format details that would be helpful for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently communicates the tool's purpose, scope, and limitations. Every word earns its place with no redundant information or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read operation with no annotations and no output schema, the description provides adequate basic information about what the tool does and what data it returns. However, it lacks details about the response format, error handling, or any behavioral constraints that would help an agent use it effectively in complex scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already documents all three parameters thoroughly. The description doesn't add any additional parameter semantics beyond what's in the schema descriptions, so it meets the baseline expectation without providing extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('retrieves detailed information'), the target resource ('a specified service'), and the scope of information returned ('including metadata and clusters, not including instance list'). It distinguishes this tool from sibling tools like 'list_service_instances' by explicitly excluding instance data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool by specifying what information it returns (metadata and clusters) and what it excludes (instance list). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for different use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nacos-group/nacos-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server