MCPcopy Index your code
hub / github.com/github/copilot-sdk / validateName

Function validateName

nodejs/src/toolSet.ts:20–30  ·  view source on GitHub ↗
(kind: "builtin" | "mcp" | "custom", name: string)

Source from the content-addressed store, hash-verified

18const VALID_TOOL_NAME = /^[a-zA-Z0-9_-]+$/;
19
20function validateName(kind: "builtin" | "mcp" | "custom", name: string): void {
21 if (name === "*") {
22 return;
23 }
24 if (!VALID_TOOL_NAME.test(name)) {
25 throw new Error(
26 `Invalid ${kind} tool name '${name}': tool names must match /^[a-zA-Z0-9_-]+$/ ` +
27 `or be the wildcard '*'.`
28 );
29 }
30}
31
32/**
33 * Builder that produces a list of source-qualified tool filter strings for

Callers 3

addBuiltInMethod · 0.85
addCustomMethod · 0.85
addMcpMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…