Skip to main content
Glama

create_schema

Creates a typed schema for an AI agent, supporting persona, API, database, workflow, skill, and MCP tool/resource configurations. Structure payloads by schema type and validate them before saving.

Instructions

Cria um novo schema para um agente. O schema_data varia conforme o tipo:

  • persona_config: { editor_schema: { persona: { role, objective, tone, language, expertise, constraints, personality_traits, custom_guidelines } } }

  • api_config: { tool_definition, editor_schema } — ATENÇÃO: endpoint.name DEVE ser igual a tool_definition.name

  • db_config: { connection_id, tool_definition, query_template, parameter_mapping }

  • workflow_config: { steps, transitions, conditions }

  • skill_config: { skill: { name, instructions, priority? } } — instruções comportamentais transversais

  • mcp_tool_config / mcp_resource_config: vínculo de tool/resource de MCP server (normalmente gerados pelo Builder) Triggers e CSPs NÃO são schemas: use create_trigger e create_csp.

WORKFLOW RECOMENDADO (evita erros de contrato): leia o resource zihin://schemas/{schema_type} (JSON Schema formal — o mesmo que o servidor valida), monte o schema_data, valide com validate_schema_data (dry-run), então crie.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNome do schema
agent_idYesUUID do agente
descriptionNoDescrição do schema
schema_dataYesDados do schema. Estrutura por tipo: PERSONA_CONFIG: { editor_schema: { persona: { role: string (obrigatório, minLength 3), objective: string (obrigatório, minLength 10), tone?: string, language?: string, expertise?: string[], constraints?: string[], personality_traits?: string[], custom_guidelines?: object, response_style?: { format?: string, rules?: string[], max_response_length?: number } } } } API_CONFIG: { tool_definition: { name: string (snake_case), description: string (min 20 chars), input_schema: { type: "object", required: string[], properties: { campo: { type, description } } } }, editor_schema: { api: { base_url: string (URL), endpoints: [{ name: string (DEVE ser igual a tool_definition.name), method: "GET"|"POST"|"PUT"|"DELETE", path: string }], auth?: { prefix: "Bearer"|"Basic", secret_ref: string } } } } REGRAS CRÍTICAS para API_CONFIG: 1. endpoint.name DEVE ser IGUAL a tool_definition.name (senão a tool falha no roteamento interno) 2. Path parameters usam formato ${variavel} (com cifrão). Ex: /resources/${resource_id}/items 3. Auth: usar "prefix" (não "type") no objeto auth. Ex: { "prefix": "Bearer", "secret_ref": "MY_TOKEN" }. Para Basic Auth, armazenar o secret já em base64 4. Para input_schema com objetos aninhados (ex: body complexo com sub-objetos), definir cada campo como type "object" com suas próprias properties CAMPOS DE TRANSFORMAÇÃO (opcionais em cada endpoint): - default_body: { "from": "noreply@x.com" } — valores fixos mergeados no body (LLM pode sobrescrever, exceto locked_fields) - locked_fields: ["from"] — campos do default_body que o LLM NÃO pode sobrescrever (enforcement server-side) - field_mapping: { "body": "html" } — renomeia campos do body antes de enviar (body vira html) - array_fields: ["to", "cc"] — garante que esses campos sejam sempre arrays - body_format: "array" — wrappa o body inteiro em array [body] (default: "object") - defaults_from_context: { "userId": "idUsuario" } — auto-inject de valores do webhookContext quando LLM não fornece DB_CONFIG: { connection_id: uuid (de private_context_connections), tool_definition: { name, description, input_schema }, query_template: string (SQL com $1, $2...), parameter_mapping: string[] (campos do input na ordem dos $N), result_mapping?: { format: "raw"|"table"|"summary", max_rows?: number } } WORKFLOW_CONFIG: { steps: [{ id, name, action }], transitions: [{ from, to, condition }], conditions?: array } SKILL_CONFIG: { skill: { name: string (minLength 3), instructions: string (minLength 50, markdown com regras comportamentais), priority?: integer (0-1000, default 0, maior = aparece primeiro no prompt) } } Contrato formal de cada tipo: resource zihin://schemas/{schema_type}. CSPs não são schemas — campos multi-agent (max_agent_depth, allowed_invoke_agents, child_timeout_ms) vivem em create_csp com policy_type=behavior.
schema_typeYesTipo do schema
Install Server

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations only provide boolean hints (readOnly=false, idempotent=false, destructive=false). The description adds substantial behavioral context beyond those flags: it warns about the API_CONFIG endpoint.name/tool_definition.name equality requirement, describes transformation-field semantics, notes that mcp_tool_config/mcp_resource_config are usually Builder-generated, and recommends a validation workflow to avoid contract errors. It doesn't detail duplicate-name behavior or failure modes, but the annotations already signal non-idempotency, so this is acceptable.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured and front-loaded: purpose, then type breakdown, then exclusions, then workflow. It earns its length given the schema-type complexity. Minor redundancy exists because much of the schema_data description is repeated from the input schema, but the use of bold headers and bullets keeps it scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a create tool with seven schema types, complex nested parameters, and meaningful variant behavior, the description is very complete. It covers exclusions (triggers/CSPs), formal contracts, validation workflow, and even notes that MCP configurations are typically Builder-generated. No output schema exists, so the description and schema together give an agent what it needs to call the tool correctly.

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

Parameters4/5

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

Schema description coverage is high and the schema itself is very detailed, so the baseline is 3. The description still adds value by summarizing the type-specific schema_data shapes and by covering mcp_tool_config and mcp_resource_config, which the schema_data description in the schema does not detail. It also adds the pointer to the formal contract resource (zihin://schemas/{schema_type}) and the dry-run validation step, which helps an agent construct schema_data correctly.

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 opens with a specific verb and resource: 'Cria um novo schema para um agente.' It also distinguishes itself from sibling tools by explicitly stating that triggers and CSPs are not schemas and should be created via create_trigger and create_csp, which makes the tool's boundary clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit when-to-use guidance by enumerating the supported schema types and by saying 'Triggers e CSPs NÃO são schemas: use create_trigger e create_csp.' It also provides a recommended workflow: read the formal schema resource, build schema_data, validate with validate_schema_data (dry-run), then create. This is actionable and prevents contract errors.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/zihin-ai/zihin-mcp'

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