Skip to main content
Glama
mcgiverdev

MCP API Server

by mcgiverdev

crear-empresa

Create a new company with required details including name, contact information, address, website, industry, and size classification.

Instructions

Crea una nueva empresa con todos los datos requeridos

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
emailYes
phoneYes
addressYes
websiteYes
industryYes
sizeYes

Implementation Reference

  • The createCompanyToolHandler function executes the tool logic: processes input args, calls companyService.createCompany, formats success/error response.
    export async function createCompanyToolHandler(args: any) {
      try {
        // Convertir el tamaño string al enum correspondiente
        const companyData = {
          ...args,
          size: args.size as CompanySize
        };
        
        const company = await companyService.createCompany(companyData);
        
        return {
          content: [
            {
              type: "text" as const,
              text: `✅ Empresa creada exitosamente:
              
    ID: ${company.id}
    Nombre: ${company.name}
    Email: ${company.email}
    Teléfono: ${company.phone}
    Dirección: ${company.address}
    Sitio web: ${company.website}
    Industria: ${company.industry}
    Tamaño: ${company.size}
    Creada: ${new Date(company.created_at).toLocaleString()}`
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Error desconocido';
        return {
          content: [
            {
              type: "text" as const,
              text: `❌ Error al crear la empresa: ${errorMessage}`
            }
          ]
        };
      }
    }
  • Zod schema for input validation of company creation: name, email, phone, address, website, industry, size.
    export const createCompanyInputSchema = {
      name: z.string().min(1, "El nombre es requerido"),
      email: z.string().email("Debe ser un email válido"),
      phone: z.string().min(1, "El teléfono es requerido"),
      address: z.string().min(1, "La dirección es requerida"),
      website: z.string().url("Debe ser una URL válida"),
      industry: z.string().min(1, "La industria es requerida"),
      size: z.enum(["small", "medium", "large"], {
        errorMap: () => ({ message: "El tamaño debe ser uno de: small, medium, large" })
      })
    };
  • src/main.ts:53-60 (registration)
    Registration of the 'crear-empresa' tool in the MCP server, linking schema and handler.
    server.registerTool(
      "crear-empresa",
      {
        description: "Crea una nueva empresa con todos los datos requeridos",
        inputSchema: createCompanyInputSchema
      },
      createCompanyToolHandler
    );
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. It states this is a creation operation ('crea'), implying a write/mutation, but doesn't mention permissions needed, whether the operation is idempotent, what happens on duplicate data, or what the response looks like. For a mutation tool with zero annotation coverage, this is insufficient.

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 gets straight to the point with no wasted words. It's appropriately sized for a creation tool and front-loads the essential information.

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 mutation tool with 7 required parameters, 0% schema description coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain parameter meanings, behavioral traits, or what to expect upon success/failure. The agent would struggle to use this tool correctly without additional context.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'todos los datos requeridos' (all required data), which hints at the 7 required parameters but doesn't explain what each parameter means, their formats, or constraints. The description adds minimal value beyond what the schema structure already shows.

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 ('crea' - creates) and resource ('una nueva empresa' - a new company), making the purpose specific and understandable. However, it doesn't differentiate from sibling tools like 'crear-usuario' beyond mentioning 'empresa' vs 'usuario', which is implicit but not explicit differentiation.

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 'listar-empresas' or 'crear-usuario'. It mentions 'con todos los datos requeridos' (with all required data), which hints at prerequisites but doesn't specify when this tool is appropriate versus other company-related operations.

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/mcgiverdev/mcp-api-v1'

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