MCPcopy Create free account
hub / github.com/QuantGeekDev/mongo-mcp / validateObject

Function validateObject

src/tools/base/tool.ts:37–45  ·  view source on GitHub ↗
(
    value: unknown,
    name: string
  )

Source from the content-addressed store, hash-verified

35 }
36
37 protected validateObject(
38 value: unknown,
39 name: string
40 ): Record<string, unknown> {
41 if (!value || typeof value !== "object") {
42 throw new McpError(ErrorCode.InvalidRequest, `${name} must be an object`);
43 }
44 return value as Record<string, unknown>;
45 }
46
47 protected handleError(error: unknown): ToolResponse {
48 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected