MCPcopy Create free account
hub / github.com/bytebase/bytebase / limitForInclude

Function limitForInclude

backend/api/mcp/tool_schema.go:373–381  ·  view source on GitHub ↗

limitForInclude returns the per-schema `limit` value to send to the server. Summary and single-table modes don't need a limit. Bulk modes request schemaTableLimit+1 so the client can disambiguate exactly-200 from truncated-at-200.

(include, table string)

Source from the content-addressed store, hash-verified

371// schemaTableLimit+1 so the client can disambiguate exactly-200 from
372// truncated-at-200.
373func limitForInclude(include, table string) int32 {
374 if table != "" {
375 return 0
376 }
377 if include == schemaIncludeColumns || include == schemaIncludeDetails {
378 return int32(schemaTableLimit + 1)
379 }
380 return 0
381}
382
383// fetchMetadata calls DatabaseService/GetDatabaseMetadata and decodes the response.
384func (s *Server) fetchMetadata(ctx context.Context, resourceName, filter string, limit int32) (*databaseMetadata, error) {

Callers 1

handleGetSchemaMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected