Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
script.md1.48 kB
--- layout: two-cols-header --- # PDF analyzer Analyze a PDF file and extract data to schematized JSON file. ::left:: <v-click> ```js // context const file = def("FILE", env.files, { endsWith: ".pdf" }) ``` </v-click> <v-click> ```js // task $`Analyze ${file} and extract data.` ``` </v-click> <v-click> ```js // output $`Save data to '<file>.json' where <file> is the filename.` ``` </v-click> <v-click> ```js // schemas const schema = defSchema("DATA", [{ name: "name", value: 1 }]) ``` </v-click> <v-click> ```js // structured output $`Format results as JSON using the ${schema} schema.` ``` </v-click> <v-click> ```js // tools, agents defTool("read_file", "reads a file", async ({ filename }) => await workspace.readText(filename)) ``` </v-click> ::right:: # <v-click at="1"> ````markdown FILE: "example.pdf" Lorem ipsum... ```` </v-click> <v-click at="2"> ````markdown Analyze FILE and extract data. + system.cot ```` </v-click> <v-click at="3"> ````markdown Save data to '<file>.json' where <file> is the filename. + system.files ```` </v-click> <v-click at="4"> ```markdown SCHEMA: type DATA = Array<{ name: string; value: number }> + system.schemas ``` </v-click> <v-click at="5"> ```markdown Format results as JSON using the DATA schema. ``` </v-click> <v-click at="6"> ```json // OpenAI tool { ..., "tools": [{ "name": "read_file", "description": "reads a file", "parameters": {...}, ``` </v-click>

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/microsoft/genaiscript'

If you have feedback or need assistance with the MCP directory API, please join our Discord server