Skip to main content
Glama

businessobject-function-test

Read-onlyIdempotent

Execute business object functions with input parameters to test functionality and verify results using real data.

Instructions

#Test a Business Object Function

Execute a business object function with provided input parameters for testing purposes. This allows you to test your functions with real data and see the results.

Common Base Data Type IDs:

  • String: "22ED1F787B6B0926AB0577860AF7543705341C053EB1B4A74E7CC199A0645E52"

  • Integer: "B9B1191E0B70BA0845CF4F6A4F4C017594F8BA84FD2F1849966081D53A8C836D"

  • Boolean: "2788FB5AA776C62635F156C820190D0FD3D558765201881A77382093F7248B39"

  • Date: "06A9841478D7BE17C423F11C38CD6829E372093DBEC144F2A85FC7165BE8CD80"

  • Float: "C09139C72F5A8A7E0036BA66CE301748BD617F463683EE03F92EDAAAA4AF8BC7"

  • Any: "D31053204B4A612390A2D6ECDF623E979C14ADC070A7CB9B08B2099C3011BCAB"

Parameter Usage:

  • Use parameter "name" if no alias is defined

  • Use parameter "alias" instead of name if alias is defined in the function

  • Values must match the expected data type

Error Handling:

  • Wrong BO/function name → 404 error

  • Missing required parameters → 400 error

  • Wrong parameter names → 400/500 error

  • Invalid parameter values → 400/500 error

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
businessObjectNameYes
functionNameYes
inputParametersNoInput parameters for the function

Implementation Reference

  • The handler function for the 'businessobject-function-test' tool. It fetches the function's input parameters, maps provided test values to them, fetches data types, constructs a test request, executes the test via simplifier.testServerBusinessObjectFunction, and formats the success or error response.
    }, async ({ businessObjectName, functionName, inputParameters }) => {
      return wrapToolResult(`test Business Object function ${businessObjectName}.${functionName}`, async () => {
        const boParameters = (await simplifier.getServerBusinessObjectFunction(businessObjectName, functionName)).inputParameters
    
        const testParameters: BusinessObjectTestParameter[]  = await Promise.all(boParameters.map(async cparam => {
          const dataType = await simplifier.getDataTypeByName(cparam.dataType.name)
          return {
            name: cparam.name,
            value: inputParameters.find(p => p.name === cparam.name)?.value,
            dataType: dataType,
            dataTypeId: dataType.id,
            optional: cparam.isOptional,
            transfer: true,
          } satisfies BusinessObjectTestParameter;
        }))
    
        const testRequest: BusinessObjectTestRequest = {
          parameters: testParameters
        };
    
        const trackingKey = trackingToolPrefix + toolNameBusinessObjectFunctionTest
        const result = await simplifier.testServerBusinessObjectFunction(businessObjectName, functionName, testRequest, trackingKey);
    
        // Format the response nicely
        if (result.success) {
          return {
            success: true,
            message: `Function '${functionName}' executed successfully`,
            result: result.result,
            executedWith: {
              businessObject: businessObjectName,
              function: functionName,
              parameters: testParameters.map(p => ({ name: p.name, value: p.value, dataType: p.dataTypeId }))
            }
          };
        } else {
          return {
            success: false,
            message: `Function '${functionName}' execution failed`,
            error: result.error || result.message || "Unknown error",
            executedWith: {
              businessObject: businessObjectName,
              function: functionName,
              parameters: testParameters.map(p => ({ name: p.name, value: p.value, dataType: p.dataTypeId }))
            }
          };
        }
      });
    });
  • Zod input schema for the tool defining parameters: businessObjectName (string), functionName (string), inputParameters (array of {name: string, value: unknown}).
    {
      businessObjectName: z.string(),
      functionName: z.string(),
      inputParameters: z.array(z.object({
        name: z.string().describe("Parameter name (or alias if defined)"),
        value: z.unknown().describe("Parameter value - can be any JSON value"),
      })).optional().default([]).describe("Input parameters for the function")
    },
  • Registration of the tool using McpServer.tool() method, specifying name, description, input schema, hints, and handler function.
    server.tool(toolNameBusinessObjectFunctionTest,
      functionTestDescription,
      {
        businessObjectName: z.string(),
        functionName: z.string(),
        inputParameters: z.array(z.object({
          name: z.string().describe("Parameter name (or alias if defined)"),
          value: z.unknown().describe("Parameter value - can be any JSON value"),
        })).optional().default([]).describe("Input parameters for the function")
      },
      {
        title: "Test a Business Object Function",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false
      }, async ({ businessObjectName, functionName, inputParameters }) => {
Behavior4/5

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

The description adds significant behavioral context beyond what annotations provide. While annotations indicate read-only, non-destructive, and idempotent operations, the description adds crucial details about error handling (404 for wrong names, 400/500 for parameter issues), parameter usage rules (name vs. alias), and data type requirements. This provides valuable operational context that annotations alone don't convey.

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

Conciseness4/5

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

The description is well-structured with clear sections (Common Base Data Type IDs, Parameter Usage, Error Handling) and front-loads the core purpose. While comprehensive, some information like the full list of data type IDs could be considered slightly verbose, but each section earns its place by providing essential operational guidance.

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 3-parameter tool with no output schema and only 33% schema description coverage, the description provides substantial contextual information. It covers purpose, usage, parameters, data types, and error handling comprehensively. The main gap is the lack of information about return values or output format, which would be helpful given the absence of an output schema.

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

Parameters5/5

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

With only 33% schema description coverage, the description compensates substantially by explaining parameter usage in detail. It clarifies the relationship between 'name' and 'alias' parameters, provides data type IDs for common types, and explains value matching requirements. This adds meaningful semantic understanding beyond the basic schema structure, fully addressing the coverage gap.

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 ('Execute a business object function with provided input parameters for testing purposes') and distinguishes it from siblings by focusing on testing rather than creation, deletion, or updating. It explicitly mentions this is for testing with real data, which differentiates it from other business object tools that perform modifications.

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 ('for testing purposes' and 'test your functions with real data'), but doesn't explicitly state when NOT to use it or name specific alternatives. It implies usage for testing functions rather than production execution, but lacks explicit exclusions or comparisons to sibling tools like businessobject-function-update.

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/simplifier-ag/simplifier-mcp'

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