search_contact_organisations
Find organizations by name in your contact database to quickly access company information for proposal preparation.
Instructions
Search for organisations by name in the contacts
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | Yes |
Input Schema (JSON Schema)
{
"properties": {
"search": {
"type": "string"
}
},
"required": [
"search"
],
"type": "object"
}
Implementation Reference
- The handler function that performs an API GET request to search for organisations by the provided search term, parses the response using the contactOrganisationsListSchema, handles validation errors, and returns the JSON-stringified data.async execute({ search }) { const result = await get(`/contacts/organisations/?query=${encodeURIComponent(search)}`); const parsed = contactOrganisationsListSchema.safeParse(result); if (!parsed.success) { throwApiInvalidResponseError(parsed.error); } return JSON.stringify(parsed.data); },
- Zod schema defining the input parameters for the tool: a required 'search' string.const parameters = z.object({ search: z.string(), });
- src/schemas/contacts.ts:74-74 (schema)Zod schema for the output: an array of organisation schemas, used to validate the API response in the handler.export const contactOrganisationsListSchema = z.array(organisationSchema);
- src/tools/register.ts:11-11 (registration)Import statement bringing in the tool definition for registration.import { searchContactOrganisationsTool } from './contacts/search-contact-organisations.js';
- src/tools/register.ts:37-39 (registration)Registration function that adds the tool (included in the 'tools' array at line 29) to the FastMCP server.export function registerTools({ server }: { server: FastMCP }) { (tools as unknown as FastMCPTool<Record<string, unknown>, ToolParameters>[]).map(initialContextGuard).forEach((tool) => server.addTool(tool)); }