MCPcopy Create free account
hub / github.com/agentrpc/agentrpc / validateServiceName

Function validateServiceName

sdk-node/src/util.ts:34–45  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

32};
33
34export const validateServiceName = (name: string) => {
35 if (!ALLOWED_NAME_CHARACTERS.test(name)) {
36 throw new AgentRPCError(
37 `Service name must only contain letters and numbers. Got: ${name}`,
38 );
39 }
40 if (name.length > MAX_NAME_LENGTH) {
41 throw new AgentRPCError(
42 `Service name must be less than ${MAX_NAME_LENGTH} characters: Got ${name} with length ${name.length}.`,
43 );
44 }
45};
46
47export const validateFunctionName = (name: string) => {
48 if (!ALLOWED_NAME_CHARACTERS.test(name)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected