Skip to main content
Glama

ValidateServiceBinding

Validates service binding parameters (name, service definition, package, version) using the ADT validation endpoint to ensure correctness before creation or update.

Instructions

Validate service binding parameters (name, service definition, package, version) via ADT validation endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_binding_nameYesService binding name to validate.
descriptionNoOptional description used during validation.
service_definition_nameYesService definition linked to binding.
package_nameNoABAP package for the binding.
service_binding_versionNoService binding version (for example: 1.0).

Implementation Reference

  • The main handler function that validates a service binding by calling the ADT validation endpoint. It accepts service_binding_name, service_definition_name, and optional parameters, then returns parsed validation results.
    export async function handleValidateServiceBinding(
      context: HandlerContext,
      args: ValidateServiceBindingArgs,
    ) {
      const { connection, logger } = context;
    
      try {
        if (!args?.service_binding_name) {
          throw new Error('service_binding_name is required');
        }
        if (!args?.service_definition_name) {
          throw new Error('service_definition_name is required');
        }
    
        const serviceBindingName = args.service_binding_name.trim().toUpperCase();
        const client = createAdtClient(connection, logger);
        const response = await client.getServiceBinding().validateServiceBinding({
          objname: serviceBindingName,
          serviceDefinition: args.service_definition_name.trim().toUpperCase(),
          serviceBindingVersion: args.service_binding_version?.trim() || undefined,
          description: args.description?.trim() || undefined,
          package: args.package_name?.trim().toUpperCase() || undefined,
        });
    
        return return_response({
          data: JSON.stringify(
            {
              success: true,
              service_binding_name: serviceBindingName,
              status: response.status,
              payload: parseServiceBindingPayload(response.data, 'xml'),
            },
            null,
            2,
          ),
          status: response.status,
          statusText: response.statusText,
          headers: response.headers,
          config: response.config,
        });
      } catch (error: any) {
        logger?.error('Error validating service binding:', error);
        return return_error(error);
      }
    }
  • The tool definition (input schema, description, available environments) for ValidateServiceBinding. Specifies required fields: service_binding_name and service_definition_name.
    export const TOOL_DEFINITION = {
      name: 'ValidateServiceBinding',
      available_in: ['onprem', 'cloud'] as const,
      description:
        'Validate service binding parameters (name, service definition, package, version) via ADT validation endpoint.',
      inputSchema: {
        type: 'object',
        properties: {
          service_binding_name: {
            type: 'string',
            description: 'Service binding name to validate.',
          },
          description: {
            type: 'string',
            description: 'Optional description used during validation.',
          },
          service_definition_name: {
            type: 'string',
            description: 'Service definition linked to binding.',
          },
          package_name: {
            type: 'string',
            description: 'ABAP package for the binding.',
          },
          service_binding_version: {
            type: 'string',
            description: 'Service binding version (for example: 1.0).',
          },
        },
        required: ['service_binding_name', 'service_definition_name'],
      },
    } as const;
  • Registration of ValidateServiceBinding in the HighLevelHandlersGroup, mapping the tool definition to its handler with context wrapper.
    {
      toolDefinition: ValidateServiceBinding_Tool,
      handler: withContext(handleValidateServiceBinding),
    },
  • Helper utility that parses the XML/JSON/plain response payload from the ADT validation endpoint into a structured object.
    export function parseServiceBindingPayload(
      payload: unknown,
      format: ServiceBindingResponseFormat,
    ): unknown {
      if (format === 'plain') {
        return payload;
      }
    
      if (format === 'json') {
        if (typeof payload === 'string') {
          try {
            return JSON.parse(payload);
          } catch {
            return payload;
          }
        }
        return payload;
      }
    
      if (typeof payload !== 'string') {
        return payload;
      }
    
      const trimmed = payload.trim();
      if (!trimmed.startsWith('<')) {
        return payload;
      }
    
      try {
        const parser = new XMLParser({
          ignoreAttributes: false,
          attributeNamePrefix: '',
        });
        return parser.parse(trimmed);
      } catch {
        return payload;
      }
    }
  • Compact handler that delegates directly to handleValidateServiceBinding, serving as an alternative entry point.
    export async function handleHandlerServiceBindingValidate(
      context: HandlerContext,
      args: HandlerServiceBindingValidateArgs,
    ) {
      return handleValidateServiceBinding(context, args);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only mentions 'via ADT validation endpoint.' It does not disclose whether validation is read-only, what side effects occur, error handling, or output format. Minimal transparency beyond the basic action.

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?

Single sentence with no filler, directly stating the purpose and method. Perfect conciseness for a simple validation tool.

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?

No output schema exists, yet the description does not mention return values or validation outcome. Additionally, it lacks context about the validation logic, possible errors, or behavior when validation fails. Incomplete for a tool whose sole output is the validation result.

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?

Input schema covers all 5 parameters with descriptions (100% coverage). The description merely lists the parameters without adding new semantic context (e.g., constraints, defaults, or relationships). Baseline score of 3 is appropriate as schema already conveys meaning.

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 identifies the tool's purpose: 'Validate service binding parameters' using an ADT validation endpoint. It specifies the exact resources (name, service definition, package, version) and distinguishes itself from sibling tools like ActivateServiceBinding or other Validate* tools by being specific to service bindings.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives. The description implies usage when validation of service binding parameters is needed, but fails to mention when not to use it or provide comparisons to other tools like CheckServiceBinding (if existed) or ActivateServiceBinding.

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/fr0ster/mcp-abap-adt'

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