MCPcopy Create free account
hub / github.com/bytebase/dbhub / createResourceSuccessResponse

Function createResourceSuccessResponse

src/utils/response-formatter.ts:117–131  ·  view source on GitHub ↗
(
  uri: string,
  data: T,
  meta: Record<string, any> = {}
)

Source from the content-addressed store, hash-verified

115 * Create a resource success response object
116 */
117export function createResourceSuccessResponse<T>(
118 uri: string,
119 data: T,
120 meta: Record<string, any> = {}
121) {
122 return {
123 contents: [
124 {
125 uri,
126 text: JSON.stringify(formatSuccessResponse(data, meta), bigIntReplacer, 2),
127 mimeType: "application/json",
128 },
129 ],
130 };
131}
132
133/**
134 * Format a successful prompt response in the MCP format

Callers

nothing calls this directly

Calls 1

formatSuccessResponseFunction · 0.85

Tested by

no test coverage detected