Skip to content

Commit a2de140

Browse files
feat(api): api update
1 parent bb90d39 commit a2de140

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-753a0c8375b4f2888cf6563c26df3dfa6a10e3ea29de83cd7736a20ec7295d28.yml
3-
openapi_spec_hash: d95fef5f0fbc5a22c3362ae822b814a4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-2ddb6d73ec8831eee4cb4352b85843a1f6f444e48d8be837cfcd118eddd2a63e.yml
3+
openapi_spec_hash: 1163122fba27e56fa5879bc98d32ee14
44
config_hash: 38268bb88fc4dcbb8f2f94dd138b5910

packages/mcp-server/src/local-docs-search.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ const EMBEDDED_METHODS: MethodEntry[] = [
105105
'includeImages?: boolean;',
106106
'includeLinks?: boolean;',
107107
'shortenBase64Images?: boolean;',
108+
'useMainContentOnly?: boolean;',
108109
],
109110
response: '{ markdown: string; success: true; url: string; }',
110111
markdown:
111-
"## web_scrape_md\n\n`client.web.webScrapeMd(url: string, includeImages?: boolean, includeLinks?: boolean, shortenBase64Images?: boolean): { markdown: string; success: true; url: string; }`\n\n**get** `/web/scrape/markdown`\n\nScrapes the given URL, converts the HTML content to Markdown, and returns the result.\n\n### Parameters\n\n- `url: string`\n Full URL to scrape and convert to markdown (must include http:// or https:// protocol)\n\n- `includeImages?: boolean`\n Include image references in Markdown output\n\n- `includeLinks?: boolean`\n Preserve hyperlinks in Markdown output\n\n- `shortenBase64Images?: boolean`\n Shorten base64-encoded image data in the Markdown output\n\n### Returns\n\n- `{ markdown: string; success: true; url: string; }`\n\n - `markdown: string`\n - `success: true`\n - `url: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.webScrapeMd({ url: 'https://example.com' });\n\nconsole.log(response);\n```",
112+
"## web_scrape_md\n\n`client.web.webScrapeMd(url: string, includeImages?: boolean, includeLinks?: boolean, shortenBase64Images?: boolean, useMainContentOnly?: boolean): { markdown: string; success: true; url: string; }`\n\n**get** `/web/scrape/markdown`\n\nScrapes the given URL, converts the HTML content to Markdown, and returns the result.\n\n### Parameters\n\n- `url: string`\n Full URL to scrape and convert to markdown (must include http:// or https:// protocol)\n\n- `includeImages?: boolean`\n Include image references in Markdown output\n\n- `includeLinks?: boolean`\n Preserve hyperlinks in Markdown output\n\n- `shortenBase64Images?: boolean`\n Shorten base64-encoded image data in the Markdown output\n\n- `useMainContentOnly?: boolean`\n Extract only the main content of the page, excluding headers, footers, sidebars, and navigation\n\n### Returns\n\n- `{ markdown: string; success: true; url: string; }`\n\n - `markdown: string`\n - `success: true`\n - `url: string`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.web.webScrapeMd({ url: 'https://example.com' });\n\nconsole.log(response);\n```",
112113
},
113114
{
114115
name: 'web_scrape_sitemap',

src/resources/web.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ export interface WebWebScrapeMdParams {
274274
* Shorten base64-encoded image data in the Markdown output
275275
*/
276276
shortenBase64Images?: boolean;
277+
278+
/**
279+
* Extract only the main content of the page, excluding headers, footers, sidebars,
280+
* and navigation
281+
*/
282+
useMainContentOnly?: boolean;
277283
}
278284

279285
export interface WebWebScrapeSitemapParams {

tests/api-resources/web.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ describe('resource web', () => {
8383
includeImages: true,
8484
includeLinks: true,
8585
shortenBase64Images: true,
86+
useMainContentOnly: true,
8687
});
8788
});
8889

0 commit comments

Comments
 (0)