Skip to content

Add WebIDL and descriptions to spec draft#75

Open
bwalderman wants to merge 5 commits intomainfrom
spec-draft-webidl
Open

Add WebIDL and descriptions to spec draft#75
bwalderman wants to merge 5 commits intomainfrom
spec-draft-webidl

Conversation

@bwalderman
Copy link
Collaborator

@bwalderman bwalderman commented Feb 5, 2026

An initial pass at WebIDL for the current proposed API, and short descriptions of each property/method.


Preview | Diff

Copy link
Contributor

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for starting this Brandon!

index.bs Outdated

<dt><dfn method for="ModelContext">registerTool(tool)</dfn></dt>
<dd>
Registers a single tool without clearing the existing set of tools. If a tool with the same name already exists, the method throws an Error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will also raise an error in the following cases:

  • tool name is missing
  • description is missing
  • input schema is invalid

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll mention an error being thrown for input schema invalid. I would expect a TypeError on missing tool name or description is implied by the required keyword for these properties on ModelContextTool.

index.bs Outdated
boolean readOnly;
};

callback ToolExecuteCallback = ToolResponse (object input, ModelContextClient client);
Copy link
Contributor

@beaufortfrancois beaufortfrancois Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI Chromium currently defines this as Promise<any>(any... parameters);.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the return Promise to any. I'm keeping the parameters as-is since I think these are the current consensus, even if client (used for elicitation) isn't implemented in Chromium yet.

[SecureContext, SameObject] readonly attribute ModelContextContainer modelContext;
[SecureContext, SameObject] readonly attribute ModelContext modelContext;
};
</xmp>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing is that you'll need to define what happens when modelContext is called and how its backing value is initialized. You'll want something like this: https://wicg.github.io/fenced-frame/#window-fence.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Planning to cover that in a follow up PR along with some initial method algorithms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants