Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_cos

Calculate the cosine of an angle in radians for use in mobile automation scripts, with options to store the result in a specified variable.

Instructions

Calculate cosine of an angle (in radians)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
angleYesAngle in radians
resultVariableNoVariable name to store resultresult

Implementation Reference

  • The handler function for the mqscript_cos tool. It generates MQScript code to compute the cosine of the given angle in radians and returns a formatted text response with the code snippet.
    handler: async (args: { angle: number; resultVariable?: string }) => {
      const { angle, resultVariable = 'result' } = args;
      const script = `${resultVariable} = Cos(${angle})`;
      return {
        content: [
          {
            type: 'text',
            text: `Generated MQScript cosine function:\n\`\`\`\n${script}\n\`\`\`\n\nThis calculates the cosine of ${angle} radians.`
          }
        ]
      };
    }
  • The input schema for mqscript_cos tool, defining required 'angle' parameter (number) and optional 'resultVariable' (string).
    inputSchema: {
      type: 'object' as const,
      properties: {
        angle: {
          type: 'number',
          description: 'Angle in radians'
        },
        resultVariable: {
          type: 'string',
          description: 'Variable name to store result',
          default: 'result'
        }
      },
      required: ['angle']
    },
  • src/index.ts:64-72 (registration)
    Registration of all tools including mqscript_cos via the ListToolsRequest handler, which exposes tools from ALL_TOOLS by their name, description, and inputSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: Object.values(ALL_TOOLS).map(tool => ({
          name: tool.name,
          description: tool.description,
          inputSchema: tool.inputSchema,
        })),
      };
    });
  • src/index.ts:75-88 (registration)
    The CallToolRequest handler that dispatches to the specific tool handler by matching the tool name 'mqscript_cos' and executes its handler function.
    server.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest) => {
      const { name, arguments: args } = request.params;
      
      const tool = Object.values(ALL_TOOLS).find(t => t.name === name);
      if (!tool) {
        throw new Error(`Unknown tool: ${name}`);
      }
      
      try {
        return await tool.handler(args as any || {});
      } catch (error) {
        throw new Error(`Error executing tool ${name}: ${error instanceof Error ? error.message : String(error)}`);
      }
    });
Behavior2/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 mentions the calculation but fails to describe key behaviors such as error handling for invalid inputs, precision of results, or side effects like storing results in a variable. This leaves significant gaps for a tool that performs mathematical operations.

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 that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, 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?

For a mathematical tool with no annotations and no output schema, the description is insufficient. It lacks details on return values (e.g., numeric result format), error conditions, or usage examples, leaving the agent with incomplete information to invoke the tool effectively in context.

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, clearly documenting both parameters ('angle' and 'resultVariable'). The description adds no additional semantic context beyond what the schema provides, such as valid ranges for the angle or implications of the resultVariable. Baseline 3 is appropriate since the schema does the heavy lifting.

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 ('Calculate cosine') and the resource ('an angle in radians'), distinguishing it from siblings like mqscript_sin and mqscript_tan by specifying the trigonometric function. It provides a precise verb+resource combination without being tautological.

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 offers no guidance on when to use this tool versus alternatives like mqscript_sin or mqscript_tan, nor does it mention any prerequisites or context for usage. It simply states what the tool does without indicating appropriate scenarios.

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/allegiant/MQScript_MCP'

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