|
2 | 2 |
|
3 | 3 | ## Adding a New MCP Tool |
4 | 4 |
|
5 | | -1. Identify which `packages/server/src/tools/` file it belongs in (or create a new one) |
| 5 | +1. Identify which `src/server/tools/` file it belongs in (or create a new one) |
6 | 6 | 2. Import `{ getAuthenticatedRh, text }` from `./_helpers.js` |
7 | 7 | 3. Register with `server.tool(name, description, zodSchema, handler)` |
8 | 8 | 4. Define the input schema with Zod — MCP uses these for the tool schema |
9 | 9 | 5. Wrap the handler body in try/catch, return `text({ error: String(e) })` on failure |
10 | 10 | 6. If a new file, import and call its `register*Tools(server)` in `server.ts` |
11 | | -7. Add tests in `packages/server/__tests__/tools.test.ts` |
| 11 | +7. Add tests in `__tests__/server/tools.test.ts` |
12 | 12 |
|
13 | 13 | Example: |
14 | 14 |
|
@@ -39,23 +39,23 @@ export function registerNewTools(server: McpServer): void { |
39 | 39 |
|
40 | 40 | ## Creating a New Skill |
41 | 41 |
|
42 | | -1. Create `.claude/skills/robinhood-<name>/SKILL.md` with: |
| 42 | +1. Create `skills/robinhood-<name>/SKILL.md` with: |
43 | 43 | - YAML frontmatter (`name`, `description`) |
44 | 44 | - Trigger phrases |
45 | 45 | - Step-by-step instructions for Claude |
46 | 46 | - Code patterns to follow |
47 | | -2. Create `.claude/skills/robinhood-<name>/reference.md` with API details |
| 47 | +2. Create `skills/robinhood-<name>/reference.md` with API details |
48 | 48 | 3. Keep SKILL.md under 500 lines |
49 | 49 |
|
50 | 50 | ## Adding Client Methods |
51 | 51 |
|
52 | | -1. Define a Zod schema in `packages/client/src/types.ts` (use `.passthrough()`) |
53 | | -2. Add a URL builder in `packages/client/src/urls.ts` if needed |
54 | | -3. Implement the method in `packages/client/src/client.ts`: |
| 52 | +1. Define a Zod schema in `src/client/types.ts` (use `.passthrough()`) |
| 53 | +2. Add a URL builder in `src/client/urls.ts` if needed |
| 54 | +3. Implement the method in `src/client/client.ts`: |
55 | 55 | - Use `parseOne(Schema, data)` or `parseArray(Schema, data)` for return values |
56 | 56 | - Use typed return signatures (e.g. `Promise<Quote[]>`, not `Promise<unknown[]>`) |
57 | | -4. Export the new type from `packages/client/src/index.ts` |
58 | | -5. Add tests in `packages/client/__tests__/` using `vi.mock("../src/http.js")` |
| 57 | +4. Export the new type from `src/client/index.ts` |
| 58 | +5. Add tests in `__tests__/client/` using `vi.mock("../src/http.js")` |
59 | 59 |
|
60 | 60 | ## Testing |
61 | 61 |
|
|
0 commit comments