View as Markdown
Needle icon

Needle ACTION

Search Collection

Search a collection for relevant data chunks based on a query. See the documentation.
  • Action
  • Read only
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Needle account once, then configure and run Search Collection from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "needle-search-collection",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    needle: { authProvisionId: "apn_xxxxxxx" },
    collectionId: "Collection ID",
    text: "Search Query",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Search Collection inputs
Property Type Description
collectionId Collection ID string
The ID of the collection to search in.
Required Dynamic
text Search Query string
The text to search for in the collection.
Required
maxDistance Maximum Similarity Distance string
Maximum similarity distance for the search results, between 0 and 1. Eg. 0.65.
Optional
topK Maximum Number Of Results integer
The maximum number of search results to return.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
needle-search-collection
Version
0.0.2
App
Needle
Authentication
API key
Read-only
Yes
Destructive
No
Open world
Yes