> ## 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.

# Update eval

> Update a structured project eval source file

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>;
};

Update a structured project eval source file

## Tool details

| Field | Value         |
| ----- | ------------- |
| Name  | `update_eval` |
| Group | Evals         |

## Playground

<McpToolCall
  tool="update_eval"
  initialArguments={{
"eval_id": ""
}}
/>

## Input schema

```json title="input-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "project_reference": {
      "type": "string",
      "minLength": 1,
      "description": "Project identifier or slug that scopes the tool call."
    },
    "eval_id": {
      "type": "string",
      "minLength": 1,
      "description": "Provide the eval id."
    },
    "source_target_kind": {
      "type": "string",
      "enum": [
        "project",
        "preview_branch"
      ],
      "description": "Provide the source target kind."
    },
    "target_branch_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "description": "Provide the target branch id."
        },
        {
          "type": "null",
          "description": "Provide the target branch id."
        }
      ],
      "description": "Provide the target branch id."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Human-readable name for the target record."
    },
    "description": {
      "type": "string",
      "description": "Human-readable description that clarifies the request."
    },
    "target": {
      "type": "string",
      "minLength": 1,
      "description": "Provide the target."
    },
    "dataset": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "inline",
            "json",
            "jsonl",
            "dynamic"
          ],
          "description": "Provide the kind."
        },
        "path": {
          "type": "string",
          "description": "Provide the path."
        },
        "examples": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "Unique identifier for the target record."
              },
              "input": {
                "description": "Provide the input."
              },
              "reference": {
                "description": "Provide the reference."
              },
              "metadata": {
                "type": "object",
                "additionalProperties": {
                  "description": "Additional structured values supplied to the tool."
                },
                "description": "Additional structured metadata for the request."
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false,
            "description": "One example item supplied to the tool."
          },
          "description": "Provide one or more example values."
        },
        "editable": {
          "type": "boolean",
          "description": "Provide the editable."
        },
        "dynamic": {
          "type": "boolean",
          "description": "Provide the dynamic."
        }
      },
      "required": [
        "kind",
        "editable",
        "dynamic"
      ],
      "additionalProperties": false,
      "description": "Structured dataset details used by the tool."
    },
    "repetitions": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "description": "Provide the repetitions."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One tag item supplied to the tool."
      },
      "description": "Provide one or more tag values."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "description": "Additional structured values supplied to the tool."
      },
      "description": "Additional structured metadata for the request."
    },
    "metrics": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Human-readable name for the target record."
          },
          "family": {
            "type": "string",
            "enum": [
              "answer",
              "agent",
              "ops",
              "judge",
              "knowledge",
              "check"
            ],
            "description": "Provide the family."
          },
          "severity": {
            "type": "string",
            "enum": [
              "gate",
              "soft",
              "budget"
            ],
            "description": "Provide the severity."
          },
          "threshold": {
            "type": "object",
            "properties": {
              "min": {
                "type": "number",
                "description": "Provide the min."
              },
              "max": {
                "type": "number",
                "description": "Provide the max."
              }
            },
            "additionalProperties": false,
            "description": "Structured threshold details used by the tool."
          },
          "config": {
            "type": "object",
            "additionalProperties": {
              "description": "Additional structured values supplied to the tool."
            },
            "description": "Structured config details used by the tool."
          },
          "editable": {
            "type": "boolean",
            "description": "Provide the editable."
          },
          "dynamic": {
            "type": "boolean",
            "description": "Provide the dynamic."
          }
        },
        "required": [
          "name",
          "family",
          "severity",
          "editable",
          "dynamic"
        ],
        "additionalProperties": false,
        "description": "One metric item supplied to the tool."
      },
      "description": "Provide one or more metric values."
    }
  },
  "required": [
    "eval_id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Input schema for the update_eval tool."
}
```

## Output schema

```json title="output-schema.json" theme={null}
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the returned record."
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for the returned record."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable description returned by the tool."
    },
    "target_kind": {
      "type": "string",
      "const": "agent",
      "description": "The target kind returned by the tool."
    },
    "target": {
      "type": "string",
      "description": "The target returned by the tool."
    },
    "source_path": {
      "type": "string",
      "description": "The source path returned by the tool."
    },
    "export_name": {
      "type": "string",
      "description": "The export name returned by the tool."
    },
    "dataset": {
      "description": "The dataset returned by the tool."
    },
    "metrics": {
      "type": "array",
      "items": {
        "description": "One metric item returned by the tool."
      },
      "description": "List of metrics returned by the tool."
    },
    "repetitions": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "description": "The repetitions returned by the tool."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One tag item returned by the tool."
      },
      "description": "List of tags returned by the tool."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "description": "Additional structured values returned by the tool."
      },
      "description": "Additional structured metadata returned by the tool."
    },
    "editable_fields": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One editable field item returned by the tool."
      },
      "description": "List of editable fields returned by the tool."
    },
    "dynamic_fields": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One dynamic field item returned by the tool."
      },
      "description": "List of dynamic fields returned by the tool."
    },
    "capabilities": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One capability item returned by the tool."
      },
      "description": "List of capabilities returned by the tool."
    },
    "source": {
      "type": "string",
      "description": "The source returned by the tool."
    },
    "edit_mode": {
      "type": "string",
      "enum": [
        "structured",
        "source_only"
      ],
      "description": "The edit mode returned by the tool."
    },
    "source_only_reasons": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One source only reason item returned by the tool."
      },
      "description": "List of source only reasons returned by the tool."
    }
  },
  "required": [
    "id",
    "name",
    "description",
    "target_kind",
    "target",
    "source_path",
    "export_name",
    "metrics",
    "repetitions",
    "tags",
    "metadata",
    "editable_fields",
    "dynamic_fields",
    "capabilities",
    "source",
    "edit_mode",
    "source_only_reasons"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "Structured result returned by the update_eval tool."
}
```
