Skip to main content
Glama
scmdr

SourceSync.ai MCP Server

by scmdr

semanticSearch

Find relevant content by meaning across namespaces using semantic search, enabling discovery beyond exact keyword matches.

Instructions

Performs semantic search across the namespace to find relevant content based on meaning rather than exact keyword matches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNo
queryYes
topKNo
scoreThresholdNo
filterNo
tenantIdNo
searchTypeNo

Implementation Reference

  • The core handler function in SourceSyncApiClient that performs the semantic search by making a POST request to the '/v1/search' endpoint with the provided query and parameters.
    public async semanticSearch({
      query,
      topK,
      scoreThreshold,
      filter,
      searchType,
    }: Omit<
      SourceSyncSemanticSearchRequest,
      'namespaceId'
    >): Promise<SourceSyncSearchResponse> {
      return this.client
        .url('/v1/search')
        .json({
          query,
          namespaceId: this.namespaceId,
          topK,
          scoreThreshold,
          filter,
          searchType,
        } satisfies SourceSyncSemanticSearchRequest)
        .post()
        .json<SourceSyncSearchResponse>()
    }
  • Zod schema defining the input parameters and validation for the semanticSearch tool.
    export const SemanticSearchSchema = z.object({
      namespaceId: namespaceIdSchema.optional(),
      query: z.string(),
      topK: z.number().optional(),
      scoreThreshold: z.number().optional(),
      filter: z
        .object({
          metadata: z.record(z.union([z.string(), z.array(z.string())])).optional(),
        })
        .optional(),
      tenantId: tenantIdSchema,
      searchType: SearchTypeEnum.optional(),
    })
  • src/index.ts:571-600 (registration)
    Registers the 'semanticSearch' tool with the MCP server, including description, input schema, and wrapper handler that creates a client and delegates to the semanticSearch method.
    server.tool(
      'semanticSearch',
      'Performs semantic search across the namespace to find relevant content based on meaning rather than exact keyword matches.',
      SemanticSearchSchema.shape,
      async (params: any) => {
        return safeApiCall(async () => {
          const {
            namespaceId,
            query,
            topK,
            scoreThreshold,
            filter,
            tenantId,
            searchType,
          } = params
    
          // Create a client with the provided parameters
          const client = createClient({ namespaceId, tenantId })
    
          // Call the semanticSearch method with the searchType (default to SEMANTIC if not provided)
          return await client.semanticSearch({
            query,
            topK,
            scoreThreshold,
            filter,
            searchType: searchType || SourceSyncSearchType.SEMANTIC,
          })
        })
      },
    )
  • TypeScript type definition for the SourceSyncSemanticSearchRequest used in the semanticSearch handler.
    export type SourceSyncSemanticSearchRequest = {
      query: string
      namespaceId: string
      topK?: number
      scoreThreshold?: number
      filter?: SourceSyncSearchFilter
      searchType?: SourceSyncSearchType.SEMANTIC
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the semantic nature of the search but doesn't describe important behavioral aspects like authentication requirements, rate limits, performance characteristics, error conditions, or what the search results look like. For a search tool with 7 parameters and no annotations, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently communicates the core function. It's appropriately sized for a basic tool description, though it could benefit from additional context given the complexity of the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 parameters, nested objects, no output schema, and no annotations), the description is incomplete. It doesn't explain the search results format, error handling, or how the various parameters interact. For a semantic search tool with multiple configuration options, more context is needed for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage for 7 parameters, the description fails to compensate by explaining any parameters. It mentions 'namespace' which relates to 'namespaceId' and 'query' which is required, but doesn't explain what these parameters mean, their formats, or how they affect the search behavior. The description adds minimal value beyond what's implied by the tool name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs semantic search across a namespace based on meaning rather than exact keyword matches. It specifies the verb ('performs semantic search') and resource ('across the namespace'), but doesn't distinguish it from the sibling 'hybridSearch' tool, which appears to be a related alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'hybridSearch' (which is a sibling tool). It mentions semantic search but doesn't explain when semantic search is preferable to other search methods or what specific use cases it addresses.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scmdr/sourcesyncai-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server