Skip to main content
Glama
bsmi021

Node Omnibus MCP Server

by bsmi021

create_type_definition

Generate TypeScript type definitions or interfaces by specifying name, file path, and properties to structure your Node.js project's data types.

Instructions

Create TypeScript type definitions or interfaces

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesType name
pathYesFile path
propertiesYesType properties and their types

Implementation Reference

  • The handler function that implements the create_type_definition tool by generating and writing a TypeScript interface file based on the provided name, path, and properties.
        private async handleCreateTypeDefinition(args: CreateTypeDefinitionArgs) {
            await this.validatePath(args.path);
    
            const typeContent = `export interface ${args.name} {
        ${Object.entries(args.properties)
                    .map(([key, type]) => `${key}: ${type};`)
                    .join('\n    ')}
    }
    `;
    
            const filePath = path.join(args.path, `${args.name}.ts`);
    
            try {
                await fs.writeFile(filePath, typeContent);
                return {
                    content: [
                        {
                            type: 'text',
                            text: `Type definition ${args.name} created successfully at ${filePath}`,
                        },
                    ],
                };
            } catch (error) {
                throw new McpError(
                    ErrorCode.InternalError,
                    `Failed to create type definition: ${error instanceof Error ? error.message : String(error)}`
                );
            }
        }
  • TypeScript interface defining the input arguments for the create_type_definition tool.
    interface CreateTypeDefinitionArgs extends Record<string, unknown> {
        name: string;
        path: string;
        properties: Record<string, string>;
    }
  • src/index.ts:301-323 (registration)
    Registration of the create_type_definition tool in the ListToolsRequestSchema response, including its input schema.
    {
        name: 'create_type_definition',
        description: 'Create TypeScript type definitions or interfaces',
        inputSchema: {
            type: 'object',
            properties: {
                name: {
                    type: 'string',
                    description: 'Type name',
                },
                path: {
                    type: 'string',
                    description: 'File path',
                },
                properties: {
                    type: 'object',
                    description: 'Type properties and their types',
                    additionalProperties: { type: 'string' },
                },
            },
            required: ['name', 'path', 'properties'],
        },
    },
  • src/index.ts:401-402 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes to the create_type_definition handler.
    case 'create_type_definition':
        return await this.handleCreateTypeDefinition(args as CreateTypeDefinitionArgs);
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 states the action 'create' but doesn't explain what happens after creation—whether files are written to disk, if overwrites occur, or what permissions are required. This is a significant gap for a tool that presumably writes files.

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 with zero waste. It's front-loaded with the core action and resource, 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?

Given the tool's complexity (creating files with structured data) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like file handling, error cases, or return values, leaving the agent with insufficient context for reliable use.

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, so parameters are documented in the schema. The description doesn't add any meaning beyond what the schema provides, such as explaining the format of 'properties' or how 'path' is interpreted. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'create' and the resource 'TypeScript type definitions or interfaces', making the purpose unambiguous. It doesn't explicitly differentiate from sibling tools like 'create_documentation' or 'generate_component', but the specificity of 'TypeScript type definitions' provides good clarity.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over sibling tools like 'create_documentation' or 'generate_component', nor does it specify prerequisites or context for creating type definitions.

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/bsmi021/mcp-node-omnibus-server'

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