mirror of
https://github.com/Sea-Haven-Industries/sh-mcp.git
synced 2026-10-04 04:23:12 +00:00
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
|
|
/**
|
||
|
|
* @sh-mcp/gmail public exports.
|
||
|
|
*
|
||
|
|
* The tools array is the primary export consumed by the server registry.
|
||
|
|
* Each tool is constructed with an injected GmailClient so that the server
|
||
|
|
* can supply the real GmailApiClient while tests supply a mock.
|
||
|
|
*
|
||
|
|
* Usage in a server:
|
||
|
|
*
|
||
|
|
* import { makeGmailTools } from '@sh-mcp/gmail';
|
||
|
|
* import { GmailApiClient, LiveGoogleTokenProvider } from '@sh-mcp/gmail/client';
|
||
|
|
*
|
||
|
|
* const tools = makeGmailTools(new GmailApiClient(new LiveGoogleTokenProvider()));
|
||
|
|
* registry.register(tools);
|
||
|
|
*/
|
||
|
|
|
||
|
|
export { GmailApiClient } from './client.js';
|
||
|
|
export type {
|
||
|
|
GmailClient,
|
||
|
|
GoogleTokenProvider,
|
||
|
|
EmailMessage,
|
||
|
|
EmailThread,
|
||
|
|
SearchInboxParams,
|
||
|
|
GetThreadDetailParams,
|
||
|
|
} from './client.js';
|
||
|
|
|
||
|
|
export type {
|
||
|
|
SearchInboxInput,
|
||
|
|
SearchInboxOutput,
|
||
|
|
GetEmailThreadDetailInput,
|
||
|
|
GetEmailThreadDetailOutput,
|
||
|
|
} from './tools.js';
|
||
|
|
|
||
|
|
export { makeSearchInboxTool, makeGetEmailThreadDetailTool } from './tools.js';
|
||
|
|
|
||
|
|
import type { GmailClient } from './client.js';
|
||
|
|
import type { ToolDef } from '@sh-mcp/shared';
|
||
|
|
import { makeSearchInboxTool, makeGetEmailThreadDetailTool } from './tools.js';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Convenience factory: returns all gmail tools wired to the given client.
|
||
|
|
* The server passes this array to its tool registry.
|
||
|
|
*/
|
||
|
|
export function makeGmailTools(client: GmailClient): ToolDef<unknown, unknown>[] {
|
||
|
|
return [
|
||
|
|
makeSearchInboxTool(client) as ToolDef<unknown, unknown>,
|
||
|
|
makeGetEmailThreadDetailTool(client) as ToolDef<unknown, unknown>,
|
||
|
|
];
|
||
|
|
}
|