Skip to content
WeaversDocs
Browse documentation

Weavers / MCP documentation

Prepare an experiment draft

Create a draft tied to exact strategy, source, and dataset revisions.

Creates a draft or proposalprepare_python_experiment_draft

Required permission: weavers.experiment_drafts.write

Try asking

Prepare a Python experiment draft using this project's current source and dataset. I will finish the settings in Weavers.

How it works

  • Creates a saved draft. It does not start compute or change source code.
  • Read current project metadata first. Supply the exact revision and hashes returned by Weavers, plus a new draft UUID.
  • Repeating the identical request with the same draftId reuses the draft (created: false). Do not reuse the ID for different content.
  • assistant_draft_context_changed means the project was archived or a revision/hash changed. Refresh the context before preparing a new request.
  • Open the returned relative URL on the Weavers website to finish the settings.

Inputs

FieldRequiredType & constraints
strategyIdRequiredUUID string
expectedStrategyRevisionRequiredinteger; greater than 0
draftIdRequiredUUID string
sourceRevisionRequiredinteger; greater than 0
sourceSha256Requiredstring; 64 lowercase hexadecimal characters
datasetVersionIdRequiredUUID string
datasetSha256Requiredstring; 64 lowercase hexadecimal characters
nameRequiredstring; at least 1 characters; up to 120 characters
View complete input JSON schema
Input schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "strategyId": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "expectedStrategyRevision": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "draftId": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "sourceRevision": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "sourceSha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "datasetVersionId": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "datasetSha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "strategyId",
    "expectedStrategyRevision",
    "draftId",
    "sourceRevision",
    "sourceSha256",
    "datasetVersionId",
    "datasetSha256",
    "name"
  ],
  "additionalProperties": false
}

What comes back

FieldDescription
draftId, strategyIdString UUIDs.
draftRevisionInteger. Saved draft revision.
createdBoolean. False for an identical repeated request.
mode, readyToRunAlways "python" and false.
urlRelative Weavers URL for reviewing the draft.

This table describes the decoded tool result. MCP wraps it in text content and, for object results, structuredContent.

Worked example

Fictional data. Replace identifiers, revisions and hashes with values from your own Weavers workflow.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "prepare_python_experiment_draft",
    "arguments": {
      "strategyId": "11111111-1111-4111-8111-111111111111",
      "expectedStrategyRevision": 3,
      "draftId": "44444444-4444-4444-8444-444444444444",
      "sourceRevision": 2,
      "sourceSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "datasetVersionId": "22222222-2222-4222-8222-222222222222",
      "datasetSha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "name": "Example experiment"
    }
  }
}
Decoded result

{
  "draftId": "44444444-4444-4444-8444-444444444444",
  "strategyId": "11111111-1111-4111-8111-111111111111",
  "draftRevision": 1,
  "created": true,
  "mode": "python",
  "readyToRun": false,
  "url": "/eureka?strategy=11111111-1111-4111-8111-111111111111&section=build&pythonView=experiments&experimentDraftId=44444444-4444-4444-8444-444444444444"
}

If the request fails

  • Sign in and grant weavers.experiment_drafts.write before calling this tool.
  • Use resources you can access and refresh revision information when it changes.
  • Check result.isError even when HTTP returns 200.
Find the error and next step →