> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Agent

> Create a structured agent source file. Put Veryfront tools in tool_ids, including project-local tools, built-ins like web_search, and third-party integration catalog tools returned by get_integration such as harvest__list_time_entries. Use provider_tool_ids only for provider-native model tools. Pass avatar_url from create_agent_avatar when an avatar was generated with assign:false.

export const McpToolCall = ({tool, initialArguments = {}}) => {
  const endpoint = "https://api.veryfront.com/mcp";
  const tokenStorageKey = 'veryfront.docs.mcpBearerToken';
  const escapeHtml = value => value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  const highlightJson = value => {
    const escaped = escapeHtml(value);
    return escaped.replace(/("(?:\\u[a-fA-F0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\btrue\b|\bfalse\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+\-]?\d+)?)/g, match => {
      let color = '#f3f4f6';
      if (match.endsWith(':')) {
        color = '#7dd3fc';
      } else if (match.startsWith('"')) {
        color = '#86efac';
      } else if ((/true|false/).test(match)) {
        color = '#c4b5fd';
      } else if ((/null/).test(match)) {
        color = '#fcd34d';
      } else {
        color = '#67e8f9';
      }
      return `<span style="color: ${color}">${match}</span>`;
    });
  };
  const expandJsonStrings = value => {
    if (typeof value === 'string') {
      const trimmed = value.trim();
      if (trimmed.startsWith('{') && trimmed.endsWith('}') || trimmed.startsWith('[') && trimmed.endsWith(']')) {
        try {
          return expandJsonStrings(JSON.parse(trimmed));
        } catch {}
      }
      return value;
    }
    if (Array.isArray(value)) {
      return value.map(expandJsonStrings);
    }
    if (value && typeof value === 'object') {
      return Object.fromEntries(Object.entries(value).map(([key, nestedValue]) => [key, expandJsonStrings(nestedValue)]));
    }
    return value;
  };
  const formatJson = value => {
    try {
      return JSON.stringify(expandJsonStrings(value), null, 2);
    } catch {
      return String(value);
    }
  };
  const formatResponseText = text => {
    const trimmed = text.trim();
    if (!trimmed) return 'No response body.';
    try {
      return formatJson(JSON.parse(trimmed));
    } catch {}
    const ssePayloads = trimmed.split(/\n\n+/).flatMap(chunk => chunk.split('\n').filter(line => line.startsWith('data:')).map(line => line.slice(5).trim()).filter(Boolean));
    for (let index = ssePayloads.length - 1; index >= 0; index -= 1) {
      try {
        return formatJson(JSON.parse(ssePayloads[index]));
      } catch {}
    }
    return trimmed;
  };
  const readStoredToken = () => {
    if (typeof window === 'undefined') return '';
    try {
      return window.sessionStorage.getItem(tokenStorageKey) || '';
    } catch {
      return '';
    }
  };
  const writeStoredToken = value => {
    if (typeof window === 'undefined') return;
    try {
      if (value) {
        window.sessionStorage.setItem(tokenStorageKey, value);
      } else {
        window.sessionStorage.removeItem(tokenStorageKey);
      }
    } catch {}
  };
  const [token, setToken] = useState(readStoredToken);
  const [argumentText, setArgumentText] = useState(formatJson(initialArguments));
  const [status, setStatus] = useState('Ready');
  const [response, setResponse] = useState('No response yet.');
  const [copied, setCopied] = useState(false);
  const callTool = async () => {
    if (!token.trim()) {
      setStatus('Paste a bearer token first.');
      return;
    }
    let parsedArguments;
    try {
      parsedArguments = argumentText.trim() ? JSON.parse(argumentText) : {};
    } catch {
      setStatus('Input must be valid JSON.');
      return;
    }
    const body = {
      jsonrpc: '2.0',
      id: Date.now(),
      method: 'tools/call',
      params: {
        name: tool,
        arguments: parsedArguments
      }
    };
    setStatus('Calling tool...');
    setResponse(formatJson(body));
    try {
      const result = await fetch(endpoint, {
        method: 'POST',
        headers: {
          accept: 'application/json, text/event-stream',
          'content-type': 'application/json',
          authorization: `Bearer ${token.trim()}`,
          'x-veryfront-origin': 'docs-mcp-tool-page'
        },
        body: JSON.stringify(body)
      });
      const text = await result.text();
      setStatus(result.ok ? 'Response received.' : `Request failed with HTTP ${result.status}.`);
      setResponse(formatResponseText(text));
    } catch (error) {
      setStatus('Request failed.');
      setResponse(error instanceof Error ? error.message : String(error));
    }
  };
  const copyResponse = async () => {
    try {
      await navigator.clipboard.writeText(response);
      setCopied(true);
      setTimeout(() => setCopied(false), 1500);
    } catch {
      setStatus('Copy failed.');
    }
  };
  return <div className="not-prose my-6 rounded-xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-950">
      <div className="mb-4">
        <div className="text-sm font-semibold text-gray-900 dark:text-gray-100">MCP tool call</div>
        <div className="mt-1 text-sm text-gray-600 dark:text-gray-400">
          Call <code>{tool}</code> against the Veryfront MCP endpoint.
        </div>
      </div>

      <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-100" htmlFor={`${tool}-token`}>
        Bearer token
      </label>
      <input id={`${tool}-token`} className="mb-4 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100" type="password" value={token} onChange={event => {
    const value = event.target.value;
    setToken(value);
    writeStoredToken(value);
  }} placeholder="Paste API key or JWT" />

      <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-100" htmlFor={`${tool}-arguments`}>
        Input JSON
      </label>
      <textarea id={`${tool}-arguments`} className="mb-4 min-h-40 w-full rounded-md border border-gray-300 bg-white px-3 py-2 font-mono text-sm text-gray-900 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100" value={argumentText} onChange={event => setArgumentText(event.target.value)} spellCheck={false} />

      <button className="rounded-md bg-gray-900 px-3 py-2 text-sm font-medium text-white hover:bg-gray-700 dark:bg-gray-100 dark:text-gray-950 dark:hover:bg-gray-300" type="button" onClick={callTool}>
        Call tool
      </button>

      <div className="mt-4 text-sm font-medium text-gray-900 dark:text-gray-100">{status}</div>
      <div className="mt-3 overflow-hidden rounded-md border border-gray-300 dark:border-gray-700">
        <div className="flex items-center justify-between bg-gray-100 px-3 py-2 text-sm font-medium text-gray-900 dark:bg-gray-900 dark:text-gray-100">
          <span>Output JSON</span>
          <button className="rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-900 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-100 dark:hover:bg-gray-800" type="button" onClick={copyResponse}>
            {copied ? 'Copied' : 'Copy'}
          </button>
        </div>
      <pre className="max-h-96 overflow-auto whitespace-pre-wrap break-words bg-gray-950 p-4 text-sm text-gray-100">
        <code dangerouslySetInnerHTML={{
    __html: highlightJson(response)
  }} />
      </pre>
      </div>
    </div>;
};

Create a structured agent source file. Put Veryfront tools in tool\_ids, including project-local tools, built-ins like web\_search, and third-party integration catalog tools returned by get\_integration such as harvest\_\_list\_time\_entries. Use provider\_tool\_ids only for provider-native model tools. Pass avatar\_url from create\_agent\_avatar when an avatar was generated with assign:false.

## Tool details

| Field | Value          |
| ----- | -------------- |
| Name  | `create_agent` |
| Group | Agents         |

## Playground

<McpToolCall
  tool="create_agent"
  initialArguments={{
"id": "",
"name": ""
}}
/>

## Input schema

```json title="Input schema" theme={null}
{
  "type": "object",
  "properties": {
    "project_reference": {
      "type": "string",
      "description": "Project identifier or slug associated with the record."
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[a-zA-Z0-9_-]+$",
      "description": "Unique identifier for the record."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Human-readable name for the record."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable description for the record."
    },
    "model": {
      "type": [
        "string",
        "null"
      ],
      "description": "The model associated with this record."
    },
    "system": {
      "type": "string",
      "minLength": 1,
      "description": "System prompt for the agent."
    },
    "system_prompt": {
      "type": "string",
      "minLength": 1,
      "description": "System prompt for the agent. Kept for compatibility."
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0,
          "maximum": 2,
          "description": "The temperature associated with this record."
        },
        {
          "type": "null",
          "description": "Provide the temperature."
        }
      ],
      "description": "The temperature associated with this record."
    },
    "max_steps": {
      "anyOf": [
        {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "The max steps associated with this record."
        },
        {
          "type": "null",
          "description": "Provide the max steps."
        }
      ],
      "description": "The max steps associated with this record."
    },
    "allowed_models": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One allowed model item associated with this record."
      },
      "description": "The allowed models associated with this record."
    },
    "skill_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One skill id item associated with this record."
      },
      "description": "The skill ids associated with this record."
    },
    "tool_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One tool id item associated with this record."
      },
      "description": "Tool IDs attached to the record, including project-local, built-in, and integration catalog tools."
    },
    "provider_tool_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One provider tool id item associated with this record."
      },
      "description": "Provider-native model tool IDs attached to the record."
    },
    "suggestions": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "The option 1 associated with this record."
              },
              {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Short human-readable title for the record."
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The prompt associated with this record."
                  }
                },
                "required": [
                  "title",
                  "prompt"
                ],
                "additionalProperties": false,
                "description": "Structured option 2 details associated with this record."
              }
            ],
            "description": "One suggestion item associated with this record."
          },
          "description": "List of suggestions associated with this record."
        },
        {
          "type": "null",
          "description": "Provide the suggestions."
        }
      ],
      "description": "List of suggestions associated with this record."
    },
    "avatar_url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri",
          "description": "The avatar url associated with this record."
        },
        {
          "type": "null",
          "description": "Provide the avatar url."
        }
      ],
      "description": "The avatar url associated with this record."
    },
    "security_enabled": {
      "type": "boolean",
      "description": "Whether the agent default security guardrails are enabled. This is not runtime HITL approval or per-tool approval."
    },
    "source_target_kind": {
      "type": "string",
      "description": "The source target kind associated with this record."
    },
    "target_branch_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "description": "The target branch id associated with this record."
        },
        {
          "type": "null",
          "description": "Provide the target branch id."
        }
      ],
      "description": "The target branch id associated with this record."
    }
  },
  "required": [
    "id",
    "name"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Input schema for the create_agent tool."
}
```

## Output schema

```json title="Output schema" theme={null}
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the record."
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for the record."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable description for the record."
    },
    "model": {
      "type": [
        "string",
        "null"
      ],
      "description": "The model associated with this record."
    },
    "system_prompt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The system prompt associated with this record."
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0,
          "maximum": 2,
          "description": "The temperature associated with this record."
        },
        {
          "type": "null",
          "description": "The temperature returned by the tool."
        }
      ],
      "description": "The temperature associated with this record."
    },
    "max_steps": {
      "anyOf": [
        {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "The max steps associated with this record."
        },
        {
          "type": "null",
          "description": "The max steps returned by the tool."
        }
      ],
      "description": "The max steps associated with this record."
    },
    "allowed_models": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One allowed model item associated with this record."
      },
      "description": "List of allowed models associated with this record."
    },
    "skill_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One skill id item associated with this record."
      },
      "description": "List of skill ids associated with this record."
    },
    "tool_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One tool id item associated with this record."
      },
      "description": "Tool IDs attached to the record, including project-local, built-in, and integration catalog tools."
    },
    "provider_tool_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One provider tool id item associated with this record."
      },
      "description": "Provider-native model tool IDs attached to the record."
    },
    "suggestions": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "description": "The option 1 associated with this record."
              },
              {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Short human-readable title for the record."
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The prompt associated with this record."
                  }
                },
                "required": [
                  "title",
                  "prompt"
                ],
                "additionalProperties": false,
                "description": "Structured option 2 details associated with this record."
              }
            ],
            "description": "One suggestion item associated with this record."
          },
          "description": "List of suggestions associated with this record."
        },
        {
          "type": "null",
          "description": "The suggestions returned by the tool."
        }
      ],
      "description": "List of suggestions associated with this record."
    },
    "security_enabled": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the agent default security guardrails are enabled. This is not runtime HITL approval or per-tool approval."
    },
    "source_path": {
      "type": "string",
      "description": "The source path associated with this record."
    },
    "source": {
      "type": "string",
      "description": "The source associated with this record."
    },
    "edit_mode": {
      "type": "string",
      "enum": [
        "structured",
        "source_only"
      ],
      "description": "The edit mode associated with this record."
    },
    "source_only_reasons": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One source only reason item associated with this record."
      },
      "description": "List of source only reasons associated with this record."
    },
    "avatar_url": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri",
          "description": "The avatar url associated with this record."
        },
        {
          "type": "null",
          "description": "The avatar url returned by the tool."
        }
      ],
      "description": "The avatar url associated with this record."
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "model",
    "system_prompt",
    "temperature",
    "max_steps",
    "allowed_models",
    "skill_ids",
    "tool_ids",
    "provider_tool_ids",
    "suggestions",
    "security_enabled",
    "source_path",
    "source",
    "edit_mode",
    "source_only_reasons",
    "avatar_url"
  ],
  "additionalProperties": false,
  "description": "Structured agent source output schema for MCP tools.",
  "$schema": "http://json-schema.org/draft-07/schema#"
}
```
