Skip to main content
Glama

mcp-server-datadog

Apache 2.0
4,489
103
  • Apple
tool.test.ts1.79 kB
import { describe, it, expect } from 'vitest' import { Tool } from '@modelcontextprotocol/sdk/types.js' import { createToolSchema } from '../../src/utils/tool' import { z } from 'zod' describe('createToolSchema', () => { it('should generate tool schema with correct inputSchema when definitions exist', () => { // Create a dummy schema with a matching definition for the tool name const dummySchema = z.object({ foo: z.string().describe('foo description'), bar: z.number().describe('bar description').optional(), baz: z.boolean().describe('baz description').default(false), qux: z.number().describe('qux description').min(10).max(20).default(15), }) // Call createToolSchema with the dummy schema, tool name, and description const gotTool = createToolSchema( dummySchema, 'test', 'dummy test description', ) // Expected inputSchema based on the dummy schema const expectedInputSchema: Tool = { name: 'test', description: 'dummy test description', inputSchema: { type: 'object', properties: { foo: { type: 'string', description: 'foo description', }, bar: { type: 'number', description: 'bar description', }, baz: { type: 'boolean', description: 'baz description', default: false, }, qux: { type: 'number', description: 'qux description', default: 15, minimum: 10, maximum: 20, }, }, required: ['foo'], }, } // Verify the returned tool object matches expected structure expect(gotTool).toEqual(expectedInputSchema) }) })

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/winor30/mcp-server-datadog'

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