Skip to main content
Glama

get_endpoint_details

Retrieve complete documentation for any Fortnox API endpoint, including parameters, request and response schemas, and required fields. Understand endpoint usage without authentication.

Instructions

Get complete documentation for a specific endpoint including: description, parameters (path/query), request body schema, response schema, required vs optional fields. Essential for understanding how to use an endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe API endpoint path exactly as shown in list_all_endpoints (e.g., /3/customers, /3/invoices/{DocumentNumber})
methodYesThe HTTP method (must match exactly)

Implementation Reference

  • The getEndpointDetails private method implements the core logic for the get_endpoint_details tool. It finds an endpoint by path/method from pre-loaded endpoints, then generates a detailed Markdown documentation string with parameters, request body schema, response schema, and implementation notes.
      private getEndpointDetails(args: ToolCallArguments): any {
        const path = args.path as string;
        const method = (args.method as string).toUpperCase();
    
        const endpoint = this.endpoints.find(
          e => e.path === path && e.method === method
        );
    
        if (!endpoint) {
          return {
            content: [
              {
                type: 'text',
                text: `Endpoint not found: ${method} ${path}\n\nTip: Use search_endpoints or list_all_endpoints to find the correct path.`,
              },
            ],
            isError: true,
          };
        }
    
        // Separate required and optional parameters
        const pathParams = endpoint.parameters.filter(p => p.in === 'path');
        const queryParams = endpoint.parameters.filter(p => p.in === 'query');
        const requiredParams = endpoint.parameters.filter(p => p.required);
        const optionalParams = endpoint.parameters.filter(p => !p.required);
    
        const markdown = `# ${endpoint.method} ${endpoint.path}
    
    ## Overview
    - **Operation ID**: ${endpoint.operationId}
    - **Summary**: ${endpoint.summary || 'N/A'}
    - **Resource Tags**: ${endpoint.tags?.join(', ') || 'N/A'}
    
    ## Description
    ${endpoint.description || 'No detailed description available.'}
    
    ## Parameters
    
    ${pathParams.length > 0 ? `### Path Parameters (Required)
    ${pathParams.map(p => `- **${p.name}** (${p.schema?.type || 'unknown'})
      - ${p.description || 'No description'}
      - ${p.schema?.pattern ? `Pattern: \`${p.schema.pattern}\`` : ''}
      - ${p.schema?.enum ? `Allowed values: ${p.schema.enum.join(', ')}` : ''}`).join('\n\n')}
    ` : '### Path Parameters\nNone\n'}
    
    ${queryParams.length > 0 ? `### Query Parameters
    ${queryParams.map(p => `- **${p.name}** (${p.schema?.type || 'unknown'})${p.required ? ' *REQUIRED*' : ' *optional*'}
      - ${p.description || 'No description'}
      - ${p.schema?.enum ? `Allowed values: ${p.schema.enum.join(', ')}` : ''}
      - ${p.schema?.minimum !== undefined ? `Min: ${p.schema.minimum}` : ''}
      - ${p.schema?.maximum !== undefined ? `Max: ${p.schema.maximum}` : ''}`).join('\n\n')}
    ` : '### Query Parameters\nNone\n'}
    
    ${endpoint.requestBodySchema ? `## Request Body
    Required for ${endpoint.method} requests.
    
    \`\`\`json
    ${JSON.stringify(endpoint.requestBodySchema, null, 2)}
    \`\`\`
    ` : '## Request Body\nNot applicable for this endpoint.\n'}
    
    ${endpoint.responseSchema ? `## Response Schema
    \`\`\`json
    ${JSON.stringify(endpoint.responseSchema, null, 2)}
    \`\`\`
    ` : '## Response\nResponse schema not documented in OpenAPI spec.\n'}
    
    ## Quick Reference
    - **Base URL**: https://api.fortnox.se
    - **Full URL**: https://api.fortnox.se${endpoint.path}
    - **Required Parameters**: ${requiredParams.length > 0 ? requiredParams.map(p => p.name).join(', ') : 'None'}
    - **Optional Parameters**: ${optionalParams.length > 0 ? optionalParams.map(p => p.name).join(', ') : 'None'}
    
    ## Notes for Implementation
    1. Authentication: Include 'Access-Token' header
    2. Rate Limit: 25 requests per 5 seconds
    3. Content-Type: application/json
    `;
    
        return {
          content: [
            {
              type: 'text',
              text: markdown,
            },
          ],
        };
      }
  • The tool definition with inputSchema for get_endpoint_details. It declares the tool name, description, and input schema requiring 'path' (string) and 'method' (enum of HTTP methods) as required parameters.
    {
      name: 'get_endpoint_details',
      description: 'Get complete documentation for a specific endpoint including: description, parameters (path/query), request body schema, response schema, required vs optional fields. Essential for understanding how to use an endpoint.',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'The API endpoint path exactly as shown in list_all_endpoints (e.g., /3/customers, /3/invoices/{DocumentNumber})',
          },
          method: {
            type: 'string',
            description: 'The HTTP method (must match exactly)',
            enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
          },
        },
        required: ['path', 'method'],
      },
  • src/index.ts:175-176 (registration)
    The tool registration in the handleToolCall switch-case. When the tool name 'get_endpoint_details' is received, it dispatches to the getEndpointDetails method with the provided arguments.
    case 'get_endpoint_details':
      return this.getEndpointDetails(args);
  • src/index.ts:89-90 (registration)
    The tool is registered as part of the tools array in generateTools(), which is sent to MCP via ListToolsRequestSchema handler.
    {
      name: 'get_endpoint_details',
  • The getOpenAPIParser function that creates the OpenAPIParser singleton. The parser's getAllEndpoints() method is called in the constructor to load endpoints, which are later queried by getEndpointDetails.
    export function getOpenAPIParser(): OpenAPIParser {
      if (!parser) {
        // Get the directory where this module is located
        const __filename = fileURLToPath(import.meta.url);
        const __dirname = dirname(__filename);
        
        // Load the OpenAPI spec from the project root (one level up from dist/)
        const specPath = join(__dirname, '..', 'openapi.json');
        parser = new OpenAPIParser(specPath);
      }
      return parser;
    }
Behavior3/5

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

No annotations provided; the description indicates a read-only retrieval of documentation. It does not elaborate on permissions, side effects, or limitations. Adequate for a safe, informational tool.

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?

Two sentences: first states purpose and content, second emphasizes utility. No fluff, front-loaded with key information.

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

Completeness4/5

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

For a tool with two parameters and no output schema, the description sufficiently details what the response includes. The list of contents covers typical documentation needs.

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

Parameters4/5

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

Schema coverage is 100% for both parameters. The description adds context by noting the path should match list_all_endpoints output, providing extra guidance beyond the schema.

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 it retrieves documentation for a specific endpoint, listing included details (description, parameters, schemas). It distinguishes from siblings like list_all_endpoints (lists endpoints) and get_schema_details (schema-only).

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 says 'Essential for understanding how to use an endpoint,' implying use when endpoint details are needed. It does not explicitly exclude cases or mention alternatives, so guidance is clear but not comprehensive.

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/anikghosh256/fortnox-doc-mcp'

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