Skip to main content
Glama
bmorphism

Penrose MCP Server

create_domain

Define domain-specific languages for mathematical diagrams by specifying types and predicates to create visual representation rules.

Instructions

Create domain-specific language (DSL) definitions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDomain name
typesYes

Implementation Reference

  • Main execution logic for the 'create_domain' tool. Validates input arguments, constructs and stores a Domain object in the in-memory 'domains' Map, and returns a confirmation message.
    case "create_domain": {
      const args = request.params.arguments;
      if (!args || typeof args !== 'object') {
        throw new Error('Invalid arguments');
      }
    
      const { name, types } = args as { name?: string; types?: Array<any> };
      if (!name || !Array.isArray(types)) {
        throw new Error('Invalid domain definition: requires name and types array');
      }
    
      // Validate types
      const validatedTypes: Array<DomainType> = types.map(type => {
        if (!type.name || typeof type.name !== 'string') {
          throw new Error('Invalid type definition: requires name');
        }
    
        const validatedType: DomainType = { name: type.name };
        if (type.predicates) {
          if (!Array.isArray(type.predicates)) {
            throw new Error('Invalid predicates: must be an array');
          }
          validatedType.predicates = type.predicates.map((pred: any) => {
            if (!pred.name || !Array.isArray(pred.args)) {
              throw new Error('Invalid predicate: requires name and args array');
            }
            return {
              name: String(pred.name),
              args: pred.args.map((arg: any) => String(arg))
            };
          });
        }
        return validatedType;
      });
    
      const domain: Domain = { name, types: validatedTypes };
      domains.set(name, domain);
      return {
        content: [{
          type: "text",
          text: `Created domain: ${name}`
        }]
      };
    }
  • JSON Schema defining the expected input structure for the 'create_domain' tool, including domain name and array of types with optional predicates.
    inputSchema: {
      type: "object",
      properties: {
        name: {
          type: "string",
          description: "Domain name"
        },
        types: {
          type: "array",
          items: {
            type: "object",
            properties: {
              name: {
                type: "string",
                description: "Type name"
              },
              predicates: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    name: { type: "string" },
                    args: {
                      type: "array",
                      items: { type: "string" }
                    }
                  },
                  required: ["name", "args"]
                }
              }
            },
            required: ["name"]
          }
        }
      },
      required: ["name", "types"]
    }
  • src/index.ts:172-212 (registration)
    Tool registration in the ListTools response, specifying name, description, and input schema for 'create_domain'.
    {
      name: "create_domain",
      description: "Create domain-specific language (DSL) definitions",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Domain name"
          },
          types: {
            type: "array",
            items: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Type name"
                },
                predicates: {
                  type: "array",
                  items: {
                    type: "object",
                    properties: {
                      name: { type: "string" },
                      args: {
                        type: "array",
                        items: { type: "string" }
                      }
                    },
                    required: ["name", "args"]
                  }
                }
              },
              required: ["name"]
            }
          }
        },
        required: ["name", "types"]
      }
    },
  • TypeScript type definitions for DomainType and Domain, used to type-check and structure the data created by the tool.
    interface DomainType {
      name: string;
      predicates?: Array<{
        name: string;
        args: Array<string>;
      }>;
    }
    
    interface Domain {
      name: string;
      types: Array<DomainType>;
    }
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. While 'Create' implies a write/mutation operation, it doesn't specify permissions needed, whether the operation is idempotent, what happens on conflicts, or any rate limits. For a creation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 states the core purpose without unnecessary words. It's appropriately sized for a tool with 2 parameters and gets straight to the point with zero wasted content.

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 creation tool with no annotations, no output schema, and incomplete parameter documentation (50% schema coverage), the description is inadequate. It doesn't explain what the tool returns, what happens after creation, or provide enough context about the DSL system to guide proper usage.

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 description mentions 'DSL definitions' which hints at the purpose of the parameters, but doesn't explain what 'name' and 'types' represent in this context. With 50% schema description coverage (only 'name' has a description), the description adds minimal value beyond what the schema provides, meeting the baseline for moderate schema coverage.

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 action ('Create') and the resource ('domain-specific language (DSL) definitions'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like create_style or create_substance, which likely create different types of definitions in the same system.

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 like create_style or create_substance. There's no mention of prerequisites, appropriate contexts, or exclusions, leaving the agent with no usage direction beyond the basic purpose.

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/bmorphism/penrose-mcp'

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