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

Function buildSearchObjectsTool

src/utils/tool-metadata.ts:238–284  ·  view source on GitHub ↗

* Build search_objects tool metadata for API response

(sourceId: string)

Source from the content-addressed store, hash-verified

236 * Build search_objects tool metadata for API response
237 */
238function buildSearchObjectsTool(sourceId: string): Tool {
239 const searchMetadata = getSearchObjectsMetadata(sourceId);
240
241 return {
242 name: searchMetadata.name,
243 description: searchMetadata.description,
244 parameters: [
245 {
246 name: "object_type",
247 type: "string",
248 required: true,
249 description: "Object type to search: schema, table, view, column, procedure, function, index",
250 },
251 {
252 name: "pattern",
253 type: "string",
254 required: false,
255 description: "LIKE pattern (% = any chars, _ = one char). Default: %",
256 },
257 {
258 name: "schema",
259 type: "string",
260 required: false,
261 description: "Filter to schema",
262 },
263 {
264 name: "table",
265 type: "string",
266 required: false,
267 description: "Filter to table (requires schema; column/index only)",
268 },
269 {
270 name: "detail_level",
271 type: "string",
272 required: false,
273 description: "Detail: names (minimal), summary (metadata), full (all)",
274 },
275 {
276 name: "limit",
277 type: "integer",
278 required: false,
279 description: "Max results (default: 100, max: 1000)",
280 },
281 ],
282 readonly: true, // search_objects is always readonly
283 };
284}
285
286/**
287 * Build custom tool metadata for API response

Callers 1

getToolsForSourceFunction · 0.85

Calls 1

getSearchObjectsMetadataFunction · 0.85

Tested by

no test coverage detected