PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Agent / abilities / content-read.js

content-read.js in Extendify 3.2.1, at src/Agent/abilities/content-read.js

37 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import apiFetch from '@wordpress/api-fetch';
2 import { __ } from '@wordpress/i18n';
3
4 const path = '/extendify/v1/agent/content-read';
5
6 export const contentRead = {
7 name: 'extendify/content-read',
8 label: __('Page text', 'extendify-local'),
9 description:
10 'Read one post, page, header, footer or pattern in full — either the words a visitor sees or the block markup behind them. Name it by the id another tool returned, or by its slug.',
11 inputSchema: {
12 type: 'object',
13 properties: {
14 id: {
15 type: 'integer',
16 description: 'The id of the post to read.',
17 },
18 slug: {
19 type: 'string',
20 description: 'The slug of the post to read, when its id is not known.',
21 },
22 format: {
23 type: 'string',
24 enum: ['text', 'blocks', 'excerpt'],
25 description:
26 'text for the words a visitor sees, blocks for the markup behind them, excerpt for the summary. Defaults to text.',
27 },
28 includeMeta: {
29 type: 'boolean',
30 description: 'Also return the fields stored alongside the post.',
31 },
32 },
33 },
34 annotations: { readonly: true },
35 execute: (input = {}) => apiFetch({ path, method: 'POST', data: input }),
36 };
37