Skip to main content
Glama
martin-1103
by martin-1103

get_endpoint_details

Retrieve detailed configuration and folder information for specific API endpoints to support development workflows and endpoint management.

Instructions

Get detailed endpoint configuration with folder information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpoint_idYesEndpoint ID to get details for (required)

Implementation Reference

  • The handler function that executes the 'get_endpoint_details' tool logic: validates input, fetches details from backend API with timeout and auth, formats output, handles errors.
    export async function handleGetEndpointDetails(args: Record<string, any>): Promise<McpToolResponse> {
      try {
        const { configManager, backendClient } = await getEndpointDependencies();
    
        const endpointId = args.endpoint_id as string;
        if (!endpointId) {
          throw new Error('Endpoint ID is required');
        }
    
        // Get endpoint details
        const apiEndpoints = getApiEndpoints();
        const endpoint = apiEndpoints.getEndpoint('endpointDetails', { id: endpointId });
        const fullUrl = `${backendClient.getBaseUrl()}${endpoint}`;
    
        console.error(`[EndpointTools] Requesting endpoint details from: ${fullUrl}`);
    
        // Create AbortController for timeout
        const controller = new AbortController();
        const timeoutId = setTimeout(() => controller.abort(), 30000); // 30 second timeout
    
        try {
          const result = await fetch(fullUrl, {
            method: 'GET',
            headers: {
              'Authorization': `Bearer ${backendClient.getToken()}`,
              'Content-Type': 'application/json'
            },
            signal: controller.signal
          });
    
          clearTimeout(timeoutId); // Clear timeout if request succeeds
    
          if (!result.ok) {
            throw new Error(`HTTP ${result.status}: ${result.statusText}`);
          }
    
          const data = await result.json() as EndpointDetailsResponse;
    
          if (data.success && data.data) {
            const detailsText = formatEndpointDetailsText(data.data);
    
            return {
              content: [
                {
                  type: 'text',
                  text: detailsText
                }
              ]
            };
          } else {
            return {
              content: [
                {
                  type: 'text',
                  text: `❌ Failed to get endpoint details: ${data.message || 'Unknown error'}`
                }
              ],
              isError: true
            };
          }
        // Handle network and timeout errors specifically
        } catch (networkError) {
          clearTimeout(timeoutId); // Ensure timeout is cleared on error
    
          let errorMessage = 'Network error occurred';
          if (networkError instanceof Error) {
            if (networkError.name === 'AbortError') {
              errorMessage = 'Request timeout (30 seconds)';
            } else {
              errorMessage = `Network error: ${networkError.message}`;
            }
          }
    
          return {
            content: [
              {
                type: 'text',
                text: `❌ ${errorMessage}`
            }
            ],
            isError: true
          };
        }
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `❌ Endpoint details error: ${error instanceof Error ? error.message : 'Unknown error'}`
            }
          ],
          isError: true
        };
      }
    }
  • Tool schema definition: name, description, and inputSchema for validating parameters (endpoint_id).
    // Tool: get_endpoint_details
    export const getEndpointDetailsTool: McpTool = {
      name: 'get_endpoint_details',
      description: 'Get detailed endpoint configuration with folder information',
      inputSchema: {
        type: 'object',
        properties: {
          endpoint_id: {
            type: 'string',
            description: 'Endpoint ID to get details for (required)'
          }
        },
        required: ['endpoint_id']
      }
    };
  • Maps the tool name 'get_endpoint_details' to its handler function handleGetEndpointDetails in the handlers object returned by createEndpointToolHandlers.
    export function createEndpointToolHandlers(): Record<string, EndpointToolHandler> {
      return {
        [listEndpointsTool.name]: handleListEndpoints,
        [getEndpointDetailsTool.name]: handleGetEndpointDetails,
        [createEndpointTool.name]: handleCreateEndpoint,
        [updateEndpointTool.name]: handleUpdateEndpoint,
        [deleteEndpointTool.name]: handleDeleteEndpoint
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states 'Get' implies a read operation but doesn't disclose behavioral traits like whether it requires authentication, rate limits, error handling, or what 'detailed' entails beyond folder info. This leaves significant gaps for a tool with no annotation coverage.

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, efficient sentence with no wasted words. It is front-loaded with the core action and resource, making it easy to parse quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'detailed endpoint configuration' includes, how folder information is structured, or the return format. For a tool that likely returns complex data, this leaves too much unspecified.

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?

The input schema has 100% description coverage, with 'endpoint_id' clearly documented as required. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('detailed endpoint configuration with folder information'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_environment_details' or 'get_folder_details' beyond mentioning 'folder information', which is a minor gap.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'list_endpoints' or other 'get_' tools. It lacks context about prerequisites, such as needing an endpoint ID from listing operations, or exclusions for when not to use it.

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/martin-1103/mcp2'

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