This is page 1 of 2. Use http://codebase.md/noveum/api-market-mcp-server?lines=false&page={x} to view the full context.
# Directory Structure
```
├── .dockerignore
├── .eslintrc.json
├── .gitignore
├── bin
│ └── mcp-server.js
├── build.js
├── CONTRIBUTING.md
├── Dockerfile
├── images
│ ├── example1.png
│ ├── example2.1.png
│ ├── example2.2.png
│ └── example3.png
├── INSTALL.md
├── LICENSE
├── mcp-specs.d.ts
├── modified_files.txt
├── package-lock.json
├── package.json
├── README.md
├── scripts
│ ├── inspect-watch.js
│ └── inspect.js
├── smithery.yaml
├── src
│ ├── APIMarketMCPServer.ts
│ ├── index.ts
│ ├── lib
│ │ ├── modified_brave-brave.json
│ │ ├── modified_bridgeml-codellama.json
│ │ ├── modified_bridgeml-mistralai.json
│ │ ├── modified_bridgeml-mistralai8x22.json
│ │ ├── modified_bridgeml-nsfw-detection.json
│ │ ├── modified_bridgeml-text-to-image.json
│ │ ├── modified_capix-faceswap.json
│ │ ├── modified_capix-free.json
│ │ ├── modified_capix-homegpt.json
│ │ ├── modified_capix-inpainting.json
│ │ ├── modified_capix-shortener.json
│ │ ├── modified_capix-story.json
│ │ ├── modified_magicapi-coder.json
│ │ ├── modified_magicapi-colorizer.json
│ │ ├── modified_magicapi-deblurer.json
│ │ ├── modified_magicapi-dnschecker.json
│ │ ├── modified_magicapi-domainchecker.json
│ │ ├── modified_magicapi-hair.json
│ │ ├── modified_magicapi-pdf-extract.json
│ │ ├── modified_magicapi-period.json
│ │ ├── modified_magicapi-screenshot-api.json
│ │ ├── modified_magicapi-whisper.json
│ │ ├── modified_magicapi-whois.json
│ │ ├── modified_pipfeed-parse.json
│ │ ├── modified_trueway-geocoding.json
│ │ ├── modified_trueway-matrix.json
│ │ ├── modified_trueway-places.json
│ │ └── modified_trueway-routing.json
│ └── utils.ts
├── tsconfig.json
└── utils
├── LLM_summary_shortener.py
├── manual_summary_shortener.py
└── modify_api.py
```
# Files
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
```
.aider*
.env
dist/
node_modules/
json_files/
```
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
```
node_modules/
json_files/
dist/
utils/
images/
```
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
```json
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "error"
}
}
```
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
```markdown
# API-MARKET MCP Server
## About
A Model Context Protocol (MCP) server that exposes API-Market's endpoints as MCP resources. This server allows Large Language Models to discover and interact with APIs defined by OpenAPI specifications through the MCP protocol.
This repository provides access to the APIs available at [API.market](https://api.market/). The tool is free to use and allows agents to communicate freely with all available APIs, making it super powerful. With over **200+ APIs** available at [API.market](https://api.market/), you can leverage a wide range of functionalities.
## Quick Start
You do not need to clone this repository to use this MCP server. You can simply configure it in your client of choice.
### For Claude Desktop
1. Locate or create your Claude Desktop configuration file:
- On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
2. Add the following configuration to enable the API-Market MCP server:
```json
{
"mcpServers": {
"api-market": {
"command": "npx",
"args": ["-y", "@noveum-ai/mcp-server"],
"env": {
"API_HEADERS": "x-magicapi-key:your-api-key"
}
}
}
}
```
### For Cursor
1. Go to File -> Preferences -> Cursor Settings.
2. Select MCP.
3. Click on Add new global MCP Server.
4. Paste the following into the mcp.json file.
```json
{
"mcpServers": {
"api-market": {
"command": "npx",
"args": [
"-y",
"@noveum-ai/mcp-server",
"--headers",
"x-magicapi-key:<your-api-key>"
]
}
}
}
```
Alternatively, add this as the first entry in mcpServers.
```json
"api-market": {
"command": "npx",
"args": [
"-y",
"@noveum-ai/mcp-server",
"--headers",
"x-magicapi-key:<your-api-key>"
]
},
```
5. For older versions of Cursor, add the following command after clicking on Add new MCP server
```bash
npx -y @noveum-ai/mcp-server --headers x-magicapi-key:your-api-key
```
## Getting an API Key from API.market
To obtain an API key
1. Log in to [API.market](https://api.market/)
2. Go to your profile and select 'My API Keys'
3. Your API keys will be displayed here
## List of APIs in this MCP
- [GET-trueway-matrix-MatrixService-CalculateDrivingMatrix](https://api.market/store/trueway/matrix)
- [GET-magicapi-whisper-predictions--request_id](https://api.market/store/magicapi/whisper)
- [POST-magicapi-whisper-whisper](https://api.market/store/magicapi/whisper)
- [POST-capix-faceswap-upload](https://api.market/store/capix/faceswap)
- [POST-capix-faceswap-faceswap-v1-image](https://api.market/store/capix/faceswap)
- [POST-capix-faceswap-faceswap-v1-video](https://api.market/store/capix/faceswap)
- [POST-capix-faceswap-result](https://api.market/store/capix/faceswap)
- [GET-trueway-geocoding-GeocodingService-Geocode](https://api.market/store/trueway/geocoding)
- [GET-trueway-geocoding-GeocodingService-ReverseGeocode](https://api.market/store/trueway/geocoding)
- [POST-magicapi-dnschecker-dnschecker](https://api.market/store/magicapi/dnschecker)
- [GET-magicapi-coder-predictions--request_id](https://api.market/store/magicapi/coder)
- [POST-magicapi-coder-coder](https://api.market/store/magicapi/coder)
- [POST-bridgeml-nsfw-detection-nsfw_detection](https://api.market/store/bridgeml/nsfw)
- [GET-magicapi-whois-whois--domain-](https://api.market/store/magicapi/whois)
- [GET-magicapi-deblurer-predictions--request_id](https://api.market/store/magicapi/deblurer)
- [POST-magicapi-deblurer-deblurer](https://api.market/store/magicapi/deblurer)
- [POST-bridgeml-text-to-image-text_to_image](https://api.market/store/bridgeml/text)
- [GET-magicapi-period-predictions--request_id](https://api.market/store/magicapi/period)
- [POST-magicapi-period-period](https://api.market/store/magicapi/period)
- [GET-trueway-places-PlacesService-FindPlaceByText](https://api.market/store/trueway/places)
- [GET-trueway-places-PlacesService-FindPlacesNearby](https://api.market/store/trueway/places)
- [GET-magicapi-hair-predictions--request_id](https://api.market/store/magicapi/hair)
- [POST-magicapi-hair-hair](https://api.market/store/magicapi/hair)
- [POST-bridgeml-codellama-bridgeml-codellama](https://api.market/store/bridgeml/codellama)
- [GET-brave-brave-videos-search](https://api.market/store/brave/brave)
- [GET-brave-brave-web-search](https://api.market/store/brave/brave)
- [GET-brave-brave-images-search](https://api.market/store/brave/brave)
- [GET-brave-brave-news-search](https://api.market/store/brave/brave)
- [GET-brave-brave-suggest-search](https://api.market/store/brave/brave)
- [GET-brave-brave-spellcheck-search](https://api.market/store/brave/brave)
- [POST-magicapi-domainchecker-check_domains](https://api.market/store/magicapi/domainchecker)
- [GET-trueway-routing-DirectionsService-FindDrivingRoute](https://api.market/store/trueway/routing)
- [GET-trueway-routing-DirectionsService-FindDrivingPath](https://api.market/store/trueway/routing)
- [POST-pipfeed-parse-extract](https://api.market/store/pipfeed/parse)
## Example and Usage
### Example 1
We can use the agent to find a route between any two points

### Example 2
We can use the agent to find news about any topic, and then dig deeper into the articles


### Example 3
We can use the agent to look for available domains

## Development
### Adding a New API to the MCP Server
The `utils` folder contains helper scripts for managing API configurations, parsing OpenAPI specifications, and registering new APIs into the MCP server.
#### 1. Locate the OpenAPI Specification
Find the OpenAPI JSON for the API you want to integrate. After that, create a folder `json_files` in the root directory of the project and add your OpenAPI JSON spec to the folder
#### 2. Modify the OpenAPI Specification
After obtaining the OpenAPI spec, use `modify_api.py` to update the path inside the spec to include the file name.
```bash
python utils/modify_api.py
```
#### 3. Update API Summaries
After modifying the paths, update the API summaries by choosing one of the following options:
- **Automatically shorten summaries using an LLM:**
```bash
python utils/LLM_summary_shortener.py
```
- **Manually update the summaries:**
```bash
python utils/manual_summary_shortener.py
```
#### 4. Build and Test
Rebuild the project to apply the changes:
```bash
npm run build
```
Then, test the new API integration using:
```bash
npm run inspect
```
#### 5. Submit Your Changes
If you want to contribute this new API to the repository:
- Fork the repo.
- Create a branch.
- Submit a pull request (PR).
#### 6. Publish the MCP server (Optional)
If you want to publish your changes:
- Update the `package.json` accordingly (e.g., update the version, name, etc.).
- Publish the package:
```bash
npm publish --access public
```
## Development Tools
### Building
- `npm run build` - Builds the TypeScript source.
- `npm run clean` - Removes build artifacts.
- `npm run typecheck` - Runs TypeScript type checking.
### Development Mode
- `npm run dev` - Watches source files and rebuilds on changes.
- `npm run inspect-watch` - Runs the inspector with auto-reload on changes.
### Code Quality
- `npm run lint` - Runs ESLint.
- `npm run typecheck` - Verifies TypeScript types.
<!-- ##### Set Environment Variables:
Configure your environment by running the following commands:
```bash
export OPENAPI_SPEC_PATH=modified_files.txt # optional
export API_BASE_URL=https://api.magicapi.dev/api/v1/ # optional
export API_HEADERS="x-magicapi-key:your-api-key"
``` -->
#### Command Line Arguments
```bash
npm run inspect -- \
--api-base-url https://api.magicapi.dev/api/v1/ \
--openapi-spec modified_files.txt \
--headers "x-magicapi-key:your-api-key" \
--name "my-mcp-server" \
--version "1.0.0"
```
### Development Workflow
1. Start the development environment:
```bash
npm run inspect-watch
```
2. Modify the TypeScript files in `src/`.
3. The server will automatically rebuild and restart.
4. Use the MCP Inspector UI to test your changes.
### Debugging or Running Locally
To debug or run the MCP server locally:
1. Clone the repository and install dependencies:
```bash
git clone https://github.com/Noveum/api-market-mcp-server.git
cd api-market-mcp-server
npm install
```
2. Build the server:
```bash
npm run build
```
3. For debugging, you can run:
```bash
npm run inspect
```
### Contributing
1. Fork the repository.
2. Create a feature branch.
3. Make your changes.
4. Run tests and linting:
```bash
npm run typecheck
npm run lint
```
5. Submit a pull request.
### License
MIT
```
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
```markdown
# Contributing to OpenAPI MCP Server
Contributions to the OpenAPI MCP Server are welcome! By participating in this project, you agree to abide by our community guidelines and code standards.
## How to Contribute
1. **Fork & Clone**
Fork the repository on GitHub and clone it to your local machine.
2. **Create a Feature Branch**
Create a new branch for your feature or bug fix:
```bash
git checkout -b feature/my-new-feature
```
3. **Make Changes**
- Follow the existing code style and best practices (e.g., TypeScript best practices).
- Add or update tests where necessary.
- Ensure your changes do not break existing functionality.
4. **Run Tests & Linting**
Before submitting your pull request, run:
```bash
npm run typecheck
npm run lint
```
5. **Submit a Pull Request**
Once your changes are ready, open a pull request against the main branch. In your PR, please include:
- A clear description of your changes.
- References to any related issues.
- Any additional context necessary to understand the changes.
## Reporting Issues
If you encounter bugs or have feature requests, please:
- Open an issue on GitHub.
- Provide detailed steps to reproduce the issue if applicable.
- Include relevant logs or screenshots to help diagnose the problem.
## Communication
For questions or further discussion, feel free to join our community on GitHub Discussions or reach out via our project's preferred communication channels.
Thank you for helping improve the OpenAPI MCP Server!
```
--------------------------------------------------------------------------------
/bin/mcp-server.js:
--------------------------------------------------------------------------------
```javascript
#!/usr/bin/env node
import "../dist/bundle.js";
```
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
```dockerfile
FROM node:22.14.0-alpine
WORKDIR /app
COPY package*.json ./
COPY . .
RUN npm install
RUN npm run build
EXPOSE 3000
```
--------------------------------------------------------------------------------
/build.js:
--------------------------------------------------------------------------------
```javascript
import * as esbuild from "esbuild";
await esbuild.build({
entryPoints: ["./src/index.ts"],
bundle: true,
platform: "node",
format: "esm",
outfile: "./dist/bundle.js",
target: "node18",
banner: {
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
},
});
```
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
```typescript
#!/usr/bin/env node
import { loadConfig } from "./utils.js";
import { APIMarketMCPServer } from "./APIMarketMCPServer.js";
async function main(): Promise<void> {
try {
const config = loadConfig();
const server = new APIMarketMCPServer(config);
await server.start();
} catch (error) {
console.error("Failed to start server:", error);
process.exit(1);
}
}
main();
export { APIMarketMCPServer, loadConfig };
```
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
```json
{
"compilerOptions": {
"outDir": "./dist",
"rootDir": ".",
"target": "ES2022",
"module": "ES2020",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true,
"sourceMap": false,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
},
"include": [
"src/**/*",
"examples/**/*"
],
"exclude": [
"node_modules",
"dist",
"**/*.test.ts"
]
}
```
--------------------------------------------------------------------------------
/smithery.yaml:
--------------------------------------------------------------------------------
```yaml
startCommand:
type: stdio
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
required:
- x-magicapi-key
properties:
x-magicapi-key:
type: string
description: The API key for the api.market website
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({command:'node',args:['./bin/mcp-server.js'],env:{API_HEADERS: `x-magicapi-key:${config["x-magicapi-key"]}`}})
```
--------------------------------------------------------------------------------
/modified_files.txt:
--------------------------------------------------------------------------------
```
../src/lib/modified_trueway-matrix.json
../src/lib/modified_magicapi-whisper.json
../src/lib/modified_capix-faceswap.json
../src/lib/modified_trueway-geocoding.json
../src/lib/modified_magicapi-dnschecker.json
../src/lib/modified_magicapi-coder.json
../src/lib/modified_bridgeml-nsfw-detection.json
../src/lib/modified_magicapi-whois.json
../src/lib/modified_magicapi-deblurer.json
../src/lib/modified_bridgeml-text-to-image.json
../src/lib/modified_magicapi-period.json
../src/lib/modified_trueway-places.json
../src/lib/modified_magicapi-hair.json
../src/lib/modified_bridgeml-codellama.json
../src/lib/modified_brave-brave.json
../src/lib/modified_magicapi-domainchecker.json
../src/lib/modified_trueway-routing.json
../src/lib/modified_pipfeed-parse.json
```
--------------------------------------------------------------------------------
/scripts/inspect.js:
--------------------------------------------------------------------------------
```javascript
#!/usr/bin/env node
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const serverPath = resolve(__dirname, '../bin/mcp-server.js');
const args = [
'npx',
'@modelcontextprotocol/inspector',
'node',
serverPath
];
// Add environment variables as CLI arguments if they exist
if (process.env.OPENAPI_SPEC_PATH) {
args.push(`--openapi-spec=${process.env.OPENAPI_SPEC_PATH}`);
}
if (process.env.API_BASE_URL) {
args.push(`--api-base-url=${process.env.API_BASE_URL}`);
}
if (process.env.SERVER_NAME) {
args.push(`--name=${process.env.SERVER_NAME}`);
}
if (process.env.API_HEADERS) {
args.push(`--headers=${process.env.API_HEADERS}`);
}
// Forward command line arguments
// Skip the first two elements which are 'node' and the script path
const cliArgs = process.argv.slice(2);
args.push(...cliArgs);
// Execute the command
import { spawn } from 'child_process';
const inspect = spawn(args[0], args.slice(1), { stdio: 'inherit' });
inspect.on('error', (err) => {
console.error('Failed to start inspector:', err);
process.exit(1);
});
inspect.on('exit', (code) => {
process.exit(code || 0);
});
```
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
```json
{
"name": "@noveum-ai/mcp-server",
"version": "1.0.4",
"description": "An MCP server that exposes OpenAPI endpoints as resources",
"license": "MIT",
"type": "module",
"main": "./dist/bundle.js",
"repository": {
"type": "git",
"url": "git+https://github.com/Noveum/api-market-mcp-server.git"
},
"bin": {
"mcp-server-contentful": "./bin/mcp-server.js"
},
"files": [
"dist",
"modified_files.txt",
"src/lib"
],
"scripts": {
"build": "node build.js && chmod +x bin/mcp-server.js",
"clean": "rm -rf dist",
"lint": "eslint src/**/*.ts",
"watch": "tsc --watch",
"typecheck": "tsc --noEmit",
"prepare": "npm run build",
"dev": "nodemon --watch src -e ts --exec 'npm run build'",
"inspect": "node -r dotenv/config ./scripts/inspect.js",
"inspect-watch": "node ./scripts/inspect-watch.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^0.4.0",
"axios": "^1.7.4",
"openapi-types": "^12.1.3",
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/jest": "^29.5.10",
"@types/node": "^20.10.0",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"dotenv": "^16.4.7",
"esbuild": "^0.19.9",
"eslint": "^8.54.0",
"jest": "^29.7.0",
"nodemon": "^3.1.7",
"ts-jest": "^29.1.1",
"typescript": "^5.3.2"
}
}
```
--------------------------------------------------------------------------------
/INSTALL.md:
--------------------------------------------------------------------------------
```markdown
# Installing and Using the OpenAPI MCP Server
This project is designed to be used as an MCP server and is primarily accessed via the **npx** command. There is no traditional installation required—simply configure your client to use the MCP server.
## Quick Start with npx
### For Claude Desktop
1. Locate or create your configuration file (e.g., `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS).
2. Add the following configuration:
```json
{
"mcpServers": {
"openapi": {
"command": "npx",
"args": ["-y", "@noveum-ai/mcp-server"],
"env": {
"API_HEADERS": "x-magicapi-key:<your-api-key>,Accept:application/json"
}
}
}
}
```
3. Replace the environment variables with your actual API configuration.
### For Cursor
1. Go to **File -> Preferences -> Cursor Settings**.
2. Select **MCP**.
3. Click on **Add New MCP Server**.
4. Paste the following command:
```bash
npx -y @noveum-ai/mcp-server --headers x-magicapi-key:<your-api-key>,Accept:application/json
```
<!-- ## Environment Variables
You can configure the following environment variables for further customization:
- **API_BASE_URL**: The base URL of your API (optional).
- **OPENAPI_SPEC_PATH**: URL or path to your OpenAPI specification (optional).
- **API_HEADERS**: Comma-separated key:value pairs for API authentication headers. -->
## For Development Purposes
To run the MCP server locally (for debugging or development):
1. **Clone the Repository and Install Dependencies**
```bash
git clone https://github.com/Noveum/api-market-mcp-server.git
cd api-market-mcp-server
npm install
```
2. **Build the Server**
```bash
npm run build
```
3. **Run or Debug the Server**
For running:
```bash
npm run inspect
```
If you have any issues or questions, please open an issue on GitHub or join our community discussions.
```
--------------------------------------------------------------------------------
/scripts/inspect-watch.js:
--------------------------------------------------------------------------------
```javascript
#!/usr/bin/env node
import { spawn } from 'child_process';
import nodemon from 'nodemon';
import { exec } from 'child_process';
let currentInspector = null;
let isShuttingDown = false;
// Function to kill all node processes running the inspector
function killAllInspectors() {
return new Promise((resolve) => {
if (process.platform === 'win32') {
exec('taskkill /F /IM node.exe /FI "WINDOWTITLE eq @modelcontextprotocol/inspector*"');
} else {
exec('pkill -f "@modelcontextprotocol/inspector"');
}
resolve();
});
}
// Function to run the inspector
function startInspector() {
if (isShuttingDown) return null;
const inspector = spawn('npm', ['run', 'inspect'], {
stdio: 'inherit',
shell: true
});
inspector.on('error', (err) => {
console.error('Inspector failed to start:', err);
});
return inspector;
}
// Cleanup function
async function cleanup() {
isShuttingDown = true;
if (currentInspector) {
currentInspector.kill('SIGTERM');
currentInspector = null;
}
await killAllInspectors();
nodemon.emit('quit');
}
// Set up nodemon to watch the src directory
nodemon({
watch: ['src'],
ext: 'ts',
exec: 'npm run build'
});
// Handle nodemon events
nodemon
.on('start', () => {
console.log('Starting build...');
})
.on('restart', async () => {
console.log('Files changed, rebuilding...');
if (currentInspector) {
currentInspector.kill('SIGTERM');
await killAllInspectors();
}
})
.on('quit', () => {
console.log('Nodemon stopped');
cleanup().then(() => process.exit(0));
})
.on('error', (err) => {
console.error('Nodemon error:', err);
})
.on('crash', () => {
console.error('Application crashed');
cleanup();
})
.on('exit', () => {
if (!isShuttingDown) {
if (currentInspector) {
currentInspector.kill('SIGTERM');
}
currentInspector = startInspector();
}
});
// Handle process termination
process.on('SIGTERM', cleanup);
process.on('SIGINT', cleanup);
process.on('SIGHUP', cleanup);
// Handle uncaught exceptions
process.on('uncaughtException', (err) => {
console.error('Uncaught exception:', err);
cleanup().then(() => process.exit(1));
});
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-dnschecker.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.2.1",
"description": "API for image processing, including toonification and background removal using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/dnschecker"
}
],
"paths": {
"magicapi/dnschecker/dnschecker": {
"post": {
"summary": "DNS Checker API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"domain": {
"type": "string",
"default": "google.com"
}
},
"required": [
"domain"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_bridgeml-nsfw-detection.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.2.21",
"description": "API for image processing, including toonification and background removal using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/bridgeml/nsfw-detection"
}
],
"paths": {
"bridgeml/nsfw!detection/nsfw_detection": {
"post": {
"summary": "A fast nsfw detection API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image": {
"type": "string",
"default": "https://blog.api.market/wp-content/uploads/2024/07/wonder_woman.png",
"description": "The url for image that wants to be checked for nsfw"
}
},
"required": [
"image"
]
}
}
}
},
"responses": {
"200": {
"description": "Image checked successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image_url": {
"type": "string",
"description": "The image is nsfw or not"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/utils.ts:
--------------------------------------------------------------------------------
```typescript
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import path from "path";
import { fileURLToPath } from "url";
import { dirname } from "path";
import { OpenAPIV3 } from "openapi-types";
// Define __dirname for ESM compatibility
const __dirname = dirname(fileURLToPath(import.meta.url));
export interface APIMarketMCPServerConfig {
name: string;
version: string;
apiBaseUrl: string;
openApiSpec: OpenAPIV3.Document | string;
headers?: Record<string, string>;
}
export function parseHeaders(headerStr?: string): Record<string, string> {
const headers: Record<string, string> = {};
headers['Accept'] = 'application/json';
if (headerStr) {
headerStr.split(",").forEach((header) => {
const [key, value] = header.split(":");
if (key && value) headers[key.trim()] = value.trim();
});
}
return headers;
}
export function loadConfig(): APIMarketMCPServerConfig {
const argv = yargs(hideBin(process.argv))
.option("api-base-url", {
alias: "u",
type: "string",
description: "Base URL for the API",
})
.option("openapi-spec", {
alias: "s",
type: "string",
description: "Path or URL to OpenAPI specification",
})
.option("headers", {
alias: "H",
type: "string",
description: "API headers in format 'key1:value1,key2:value2'",
})
.option("name", {
alias: "n",
type: "string",
description: "Server name",
})
.option("version", {
alias: "v",
type: "string",
description: "Server version",
})
.help().argv;
// Combine CLI args and env vars, with CLI taking precedence
const apiBaseUrl = argv["api-base-url"] || process.env.API_BASE_URL || "https://api.magicapi.dev/api/v1/";
const openApiSpec = argv["openapi-spec"] || process.env.OPENAPI_SPEC_PATH || path.resolve(__dirname, '../modified_files.txt');
if (!apiBaseUrl) {
throw new Error(
"API base URL is required (--api-base-url or API_BASE_URL)",
);
}
if (!openApiSpec) {
throw new Error(
"OpenAPI spec is required (--openapi-spec or OPENAPI_SPEC_PATH)",
);
}
const headers = parseHeaders(argv.headers || process.env.API_HEADERS);
return {
name: argv.name || process.env.SERVER_NAME || "mcp-openapi-server",
version: argv.version || process.env.SERVER_VERSION || "1.0.0",
apiBaseUrl,
openApiSpec,
headers,
};
}
```
--------------------------------------------------------------------------------
/utils/manual_summary_shortener.py:
--------------------------------------------------------------------------------
```python
import os
import glob
import yaml
import json
import re
from pathlib import Path
def is_valid_string(s):
pattern = r'^[a-zA-Z0-9 _-]+$'
return bool(re.match(pattern, s))
def update_summary(current_summary: str) -> str:
"""
Prompts the user to manually enter a new summary based on the current summary.
Parameters:
current_summary (str): The summary text to be replaced.
Returns:
new_summary (str): The user-provided summary.
"""
while True:
print(f"\nOriginal summary: {current_summary}")
summaries = ["A fast text-to-image model that makes high-quality images in 4 steps", "Finding the best route and get multiple stops driving directions", "Finding the best route between an origin and a destination", "Calculate distances and durations between a set of origins and destinations."]
shortened_summaries = ["text-to-image", "best route for multiple stops", "best route bw start and stop", "distance and duration bw starts and stops"]
if current_summary in summaries:
index = summaries.index(current_summary)
current_summary = shortened_summaries[index]
print(current_summary)
return current_summary
else:
new_summary = input("Enter a new summary under 54 characters: ").strip()
if len(new_summary) < 55 and is_valid_string(new_summary):
return new_summary
else:
print("Invalid summary. Please ensure it is under 54 characters and contains only alphanumeric characters, hyphens, and underscores.")
HTTP_METHODS = {"get", "post", "put", "delete", "patch", "head", "options", "trace"}
def update_method_summaries(paths_dict):
"""
Iterate over all path entries and update the summary field in method definitions.
"""
for path, methods in paths_dict.items():
if isinstance(methods, dict):
for method, operation in methods.items():
if method.lower() in HTTP_METHODS and isinstance(operation, dict):
if "summary" in operation and isinstance(operation["summary"], str) and (len(operation["summary"]) >= 55 or not is_valid_string(operation["summary"])):
original_summary = operation["summary"]
new_summary = update_summary(current_summary=original_summary)
operation["summary"] = new_summary
file_patterns = ["*.yaml", "*.yml", "*.json"]
files = []
current_dir = (Path(__file__).parent)
directory = os.path.join( current_dir, r"../src/lib")
for pattern in file_patterns:
search_pattern = os.path.join(directory, pattern)
files.extend(glob.glob(search_pattern))
for file in files:
try:
with open(file, 'r') as f:
if file.endswith(".json"):
data = json.load(f)
else:
data = yaml.safe_load(f)
except Exception as e:
print(f"Error reading {file}: {e}")
continue
if "paths" in data and isinstance(data["paths"], dict):
update_method_summaries(data["paths"])
try:
with open(file, 'w') as f:
if file.endswith(".json"):
json.dump(data, f, indent=2)
else:
yaml.dump(data, f, sort_keys=False)
except Exception as e:
print(f"Error writing {file}: {e}")
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-whois.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.3",
"info": {
"title": "WHOIS API",
"description": "API for querying domain WHOIS information.",
"version": "1.0.2"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/whois"
}
],
"paths": {
"magicapi/whois/whois/{domain}": {
"get": {
"summary": "Get WHOIS information for a domain",
"operationId": "getWhoisInfo",
"parameters": [
{
"name": "domain",
"in": "path",
"required": true,
"description": "Domain to query WHOIS information for",
"schema": {
"type": "string"
},
"example": "google.com"
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"OrganizationName": {
"type": "string",
"nullable": true
},
"Raw": {
"type": "string"
},
"RespondedServers": {
"type": "array",
"items": {
"type": "string"
}
},
"AddressRange": {
"type": "string",
"nullable": true
}
}
}
}
},
"examples": {
"google_example": {
"summary": "Example response for google.com",
"value": {
"OrganizationName": "Google LLC",
"Raw": "Domain Name: GOOGLE.COM\nRegistrar: MarkMonitor Inc.\n...",
"RespondedServers": [
"whois.verisign-grs.com",
"whois.markmonitor.com"
],
"AddressRange": "172.217.0.0 - 172.217.255.255"
}
}
}
},
"400": {
"description": "Invalid request"
},
"401": {
"description": "Unauthorized request"
},
"404": {
"description": "Domain not found"
},
"500": {
"description": "Server error"
}
},
"security": [
{
"basicAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"WhoisResponse": {
"type": "object",
"properties": {
"OrganizationName": {
"type": "string",
"nullable": true
},
"Raw": {
"type": "string"
},
"RespondedServers": {
"type": "array",
"items": {
"type": "string"
}
},
"AddressRange": {
"type": "string",
"nullable": true
}
}
}
},
"securitySchemes": {}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-screenshot-api.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Screenshot API Updated",
"version": "1.0.4"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/screenshot-api"
}
],
"paths": {
"magicapi/screenshot!api/api/screenshot": {
"get": {
"summary": "Capture a screenshot of a webpage",
"parameters": [
{
"in": "query",
"name": "resX",
"required": true,
"schema": {
"type": "integer"
},
"example": 1280
},
{
"in": "query",
"name": "resY",
"required": true,
"schema": {
"type": "integer"
},
"example": 900
},
{
"in": "query",
"name": "outFormat",
"required": true,
"schema": {
"type": "string"
},
"example": "jpg"
},
{
"in": "query",
"name": "waitTime",
"schema": {
"type": "integer"
},
"example": 100
},
{
"in": "query",
"name": "isFullPage",
"schema": {
"type": "boolean"
},
"example": false
},
{
"in": "query",
"name": "dismissModals",
"schema": {
"type": "boolean"
},
"example": false
},
{
"in": "query",
"name": "url",
"required": true,
"schema": {
"type": "string"
},
"example": "https://api.market/"
}
],
"responses": {
"200": {
"description": "Successful screenshot capture",
"content": {
"image/jpeg": {
"schema": {
"type": "string",
"format": "binary"
},
"example": "<base64_encoded_image>"
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Invalid parameters provided"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Internal server error occurred"
}
}
}
}
}
}
},
"security": [
{
"basicAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"securitySchemes": {}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_bridgeml-text-to-image.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.2.15",
"description": "API for image processing, including toonification and background removal using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/bridgeml/text-to-image"
}
],
"paths": {
"bridgeml/text!to!image/text_to_image": {
"post": {
"summary": "text-to-image",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"default": "Futuristic space battle, hyper realistic, 4k",
"description": "The prompt for generating the image"
},
"height": {
"type": "integer",
"default": 1024,
"description": "The height of the image"
},
"width": {
"type": "integer",
"default": 1024,
"description": "The width of the image"
},
"scheduler": {
"type": "string",
"default": "K_EULER",
"description": "The scheduler to use"
},
"num_outputs": {
"type": "integer",
"default": 1,
"description": "The number of outputs"
},
"guidance_scale": {
"type": "number",
"default": 0,
"description": "The guidance scale"
},
"negative_prompt": {
"type": "string",
"default": "worst quality, low quality",
"description": "The negative prompt"
},
"num_inference_steps": {
"type": "integer",
"default": 4,
"description": "The number of inference steps"
}
},
"required": [
"prompt",
"height",
"width"
]
}
}
}
},
"responses": {
"200": {
"description": "Image generated successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image_url": {
"type": "string",
"description": "The URL of the generated image"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_bridgeml-codellama.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.2.5",
"description": "API for image processing, including toonification and background removal using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/bridgeml/codellama"
}
],
"paths": {
"bridgeml/codellama/bridgeml/codellama": {
"post": {
"summary": "BridgeML API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"description": "List of messages",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"description": "Role of the message sender",
"enum": [
"user",
"assistant"
]
},
"content": {
"type": "string",
"description": "Content of the message"
}
}
},
"example": [
{
"role": "user",
"content": "hello"
},
{
"role": "assistant",
"content": ""
}
]
},
"temperature": {
"type": "number",
"description": "Temperature for text generation",
"example": 1
},
"max_tokens": {
"type": "number",
"description": "Maximum number of tokens to generate",
"example": 256
},
"top_p": {
"type": "number",
"description": "Top P sampling value",
"example": 1
},
"frequency_penalty": {
"type": "number",
"description": "Frequency penalty value",
"example": 0
},
"stream": {
"type": "boolean",
"description": "Flag indicating if response should be streamed",
"example": false
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_bridgeml-mistralai.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.2.9",
"description": "API for image processing, including toonification and background removal using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/bridgeml/mistralai"
}
],
"paths": {
"bridgeml/mistralai/bridgeml/mistralai7b": {
"post": {
"summary": "BridgeML API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"description": "List of messages",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"description": "Role of the message sender",
"enum": [
"user",
"assistant"
]
},
"content": {
"type": "string",
"description": "Content of the message"
}
}
},
"example": [
{
"role": "user",
"content": "hello"
},
{
"role": "assistant",
"content": "Use voice of customer from an Amazon review to write an ad for a webcam."
}
]
},
"temperature": {
"type": "number",
"description": "Temperature for text generation",
"example": 1
},
"max_tokens": {
"type": "number",
"description": "Maximum number of tokens to generate",
"example": 256
},
"top_p": {
"type": "number",
"description": "Top P sampling value",
"example": 1
},
"frequency_penalty": {
"type": "number",
"description": "Frequency penalty value",
"example": 0
},
"stream": {
"type": "boolean",
"description": "Flag indicating if response should be streamed",
"example": false
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_bridgeml-mistralai8x22.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.2.9",
"description": "API for image processing, including toonification and background removal using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/bridgeml/mistralai8x22"
}
],
"paths": {
"bridgeml/mistralai8x22/bridgeml/mistralai8x22": {
"post": {
"summary": "BridgeML API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"description": "List of messages",
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"description": "Role of the message sender",
"enum": [
"user",
"assistant"
]
},
"content": {
"type": "string",
"description": "Content of the message"
}
}
},
"example": [
{
"role": "user",
"content": "hello"
},
{
"role": "assistant",
"content": "Use voice of customer from a G2 review to write an ad for GitLab."
}
]
},
"temperature": {
"type": "number",
"description": "Temperature for text generation",
"example": 1
},
"max_tokens": {
"type": "number",
"description": "Maximum number of tokens to generate",
"example": 256
},
"top_p": {
"type": "number",
"description": "Top P sampling value",
"example": 1
},
"frequency_penalty": {
"type": "number",
"description": "Frequency penalty value",
"example": 0
},
"stream": {
"type": "boolean",
"description": "Flag indicating if response should be streamed",
"example": false
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/utils/modify_api.py:
--------------------------------------------------------------------------------
```python
import json
import os
import re
from typing import List
def get_json_files(directory: str) -> List[str]:
# Pattern to match filenames like a-b-c.json, a-b.json, etc.
pattern = re.compile(r'^([\w\-]+)\.json$')
return [f for f in os.listdir(directory) if pattern.match(f)]
def replace_hyphens_in_paths(data):
if 'paths' not in data:
return data
new_paths = {}
for path, details in data['paths'].items():
new_path = path.replace('-', '_')
new_paths[new_path] = details
data['paths'] = new_paths
return data
def modify_paths(data: dict, prefix: str) -> dict:
modified_paths = {f"{prefix}{path}": details for path, details in data['paths'].items()}
data['paths'] = modified_paths
return data
def resolve_references(data):
components = data.get("components", {}).get("schemas", {})
def _resolve(item):
if isinstance(item, dict):
if "$ref" in item:
# Resolve $ref
ref_path = item["$ref"].replace("#/components/schemas/", "")
ref_obj = components.get(ref_path, {})
if not ref_obj:
raise ValueError(f"Reference {item['$ref']} not found in components.")
return _resolve(ref_obj)
if "allOf" in item:
# Resolve allOf
combined_schema = {"type": "object", "properties": {}, "required": []}
for subschema in item["allOf"]:
resolved_schema = _resolve(subschema)
combined_schema["properties"].update(resolved_schema.get("properties", {}))
combined_schema["required"].extend(resolved_schema.get("required", []))
combined_schema["required"] = list(set(combined_schema["required"]))
if "title" in item:
combined_schema["title"] = item["title"]
return combined_schema
# Recursively resolve nested schemas
return {key: _resolve(value) for key, value in item.items()}
if isinstance(item, list):
return [_resolve(sub_item) for sub_item in item]
return item
return _resolve(data)
def process_files(directory: str):
if not os.path.exists(directory):
print(f"Error: Directory '{directory}' does not exist.")
return
files = get_json_files(directory)
modified_files = []
# Create a directory for modified files if it doesn't exist
modified_dir = os.path.join('./', 'src/lib')
os.makedirs(modified_dir, exist_ok=True)
for file_name in files:
file_path = os.path.join(directory, file_name)
try:
with open(file_path, 'r') as file:
data = json.load(file)
except FileNotFoundError:
print(f"Error: File '{file_path}' not found.")
continue
except json.JSONDecodeError:
print(f"Error: File '{file_path}' contains invalid JSON.")
continue
# Generate prefix from the filename, e.g., 'a-b-c.json' -> 'a/b_c/'
file_name_no_ext = file_name.replace('.json', '')
# Replace the first hyphen with a slash
if '-' in file_name_no_ext:
file_name_no_ext = file_name_no_ext.replace('-', '/', 1)
prefix = file_name_no_ext.replace('-', '!')
try:
modified_data = modify_paths(data, prefix)
modified_data = resolve_references(modified_data)
modified_data = replace_hyphens_in_paths(modified_data)
# Save modified data to modified_json_files directory
output_file = os.path.relpath(os.path.join(modified_dir, f"modified_{file_name}"))
with open(output_file, 'w') as file:
json.dump(modified_data, file, indent=4)
modified_files.append(output_file)
except Exception as e:
print(f"Error processing file '{file_name}': {str(e)}")
continue
# Write all modified file names to a text file in the current directory
try:
with open('./modified_files.txt', 'a') as file:
modified_files = ['../' + x for x in modified_files]
file.write('\n'.join(modified_files) + '\n')
except Exception as e:
print(f"Error writing to modified_files.txt: {str(e)}")
if __name__ == "__main__":
directory = "../json_files" # Specify your directory containing the JSON files
process_files(directory)
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-period.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.1.3",
"description": "API for generating ageing gif using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/period"
}
],
"paths": {
"magicapi/period/predictions/{request_id}": {
"get": {
"summary": "Get ageing gif URL",
"description": "This endpoint retrieves the URL of the ageing gif for a given request ID.\n",
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"description": "Unique identifier for the request.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the prediction (e.g., \"succeeded\")."
},
"image_url": {
"type": "string",
"format": "uri",
"description": "URL of the ageing gif."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/period/period": {
"post": {
"summary": "Period changer",
"description": "API for generating ageing gif using AI models. Make sure to call get ageing gif URL, with the result id received from this API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image": {
"type": "string",
"default": "https://replicate.delivery/mgxm/806bea64-bb51-4c8a-bf4d-15602eb60fdd/1287.jpg"
},
"target_age": {
"type": "string",
"default": "default"
}
},
"required": [
"image",
"target_age"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-colorizer.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.1.8",
"description": "API for image colorization using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/colorizer"
}
],
"paths": {
"magicapi/colorizer/predictions/{request_id}": {
"get": {
"summary": "Get Colorized Image URL",
"description": "This endpoint retrieves the URL of the colorized image for a given request ID.\n",
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"description": "Unique identifier for the request.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the prediction (e.g., \"succeeded\")."
},
"image_url": {
"type": "string",
"format": "uri",
"description": "URL of the colorized image."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/colorizer/colorizer": {
"post": {
"summary": "Colorizes greyscale images",
"description": "This endpoint takes in a URL of an image and colorize old images\n Make sure you call get colorized image URL, MCP tool to get the URL for the request id received from this API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "uri",
"description": "URL of the main image.",
"default": "https://user-images.githubusercontent.com/5865387/56368408-58561980-61c5-11e9-9800-0678dc02b4e7.png"
}
},
"required": [
"image"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-deblurer.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.2.2",
"description": "API for image deblurring, using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/deblurer"
}
],
"paths": {
"magicapi/deblurer/predictions/{request_id}": {
"get": {
"summary": "Get Unblurred Image URL",
"description": "This endpoint retrieves the URL of the Unblurred image for a given request ID.\n",
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"description": "Unique identifier for the request.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the prediction (e.g., \"succeeded\")."
},
"image_url": {
"type": "string",
"format": "uri",
"description": "URL of the deblurred image."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/deblurer/deblurer": {
"post": {
"summary": "Deblurer",
"description": "API for image deblurring. \n Make sure you call get deblurred image URL, MCP tool to get the URL for the request id received from this API",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image": {
"type": "string",
"default": "https://replicate.delivery/mgxm/e7a66188-34c6-483b-813f-be5c96a3952b/blurry-reds-0.jpg"
},
"task_type": {
"type": "string",
"default": "Image Debluring (REDS)"
}
},
"required": [
"image",
"task_type"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_capix-inpainting.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.1.0",
"info": {
"title": "RemoveBg and Inpainting API",
"version": "0.1.5"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/capix/inpainting"
}
],
"paths": {
"capix/inpainting/inpainting": {
"post": {
"tags": [
"Inpainting"
],
"summary": "Inpainting",
"operationId": "Inpainting",
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"image_url": {
"type": "string",
"title": "Image Url",
"default": "https://telegra.ph/file/1dbd57f8abf95e6ae2911.png"
},
"mask_url": {
"type": "string",
"title": "Mask Url",
"default": "https://telegra.ph/file/2402e4a3dd551cc0bca33.png"
}
},
"required": [],
"title": "Body"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"Body_Inpainting": {
"properties": {
"image_url": {
"type": "string",
"title": "Image Url",
"default": "https://telegra.ph/file/1dbd57f8abf95e6ae2911.png"
},
"mask_url": {
"type": "string",
"title": "Mask Url",
"default": "https://telegra.ph/file/2402e4a3dd551cc0bca33.png"
}
},
"type": "object",
"title": "Body_Inpainting"
},
"Body_RemoveBg": {
"properties": {
"image_url": {
"type": "string",
"title": "Image Url",
"default": "https://telegra.ph/file/46a973ad6ff03f32b40a0.png"
}
},
"type": "object",
"title": "Body_RemoveBg"
},
"ServerError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
},
"ValidationError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
},
"ValueError": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-hair.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.1.3",
"description": "API for simulating different hair styles using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/hair"
}
],
"paths": {
"magicapi/hair/predictions/{request_id}": {
"get": {
"summary": "Get hairstyled image URL",
"description": "This endpoint retrieves the URL of the simulated hairstyle image for a given request ID.\n",
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"description": "Unique identifier for the request.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the prediction (e.g., \"succeeded\")."
},
"image_url": {
"type": "string",
"format": "uri",
"description": "URL of the hairstyled image."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/hair/hair": {
"post": {
"summary": "Hair style simulator",
"description": "API for simulating different hair styles using AI models. Make sure to call get hairstyled image after with the request id received from this API.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"image": {
"type": "string",
"default": "https://replicate.delivery/mgxm/b8be17a7-abcb-4421-80f2-e6a1e3fe38c7/MarkZuckerberg.jpg"
},
"editing_type": {
"type": "string",
"default": "both"
},
"color_description": {
"type": "string",
"default": "blond"
},
"hairstyle_description": {
"type": "string",
"default": "hi-top fade hairstyle"
}
},
"required": [
"image",
"editing_type",
"color_description",
"hairstyle_description"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_pipfeed-parse.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Pipfeed Parsing API",
"description": "The Pipfeed Parsing API allows you to extract structured data from online news articles. With advanced AI technology, this API retrieves clean, structured data including content, images, authors, summary, category, keywords, topics, and more from articles, blogs, and discussions.\n\nKey Features:\n- Extracts metadata such as title, author, site name, publication date, and article length.\n- Retrieves full HTML content of the article.\n- Identifies the main image associated with the article.\n- Provides keywords, topics, and a summary generated by AI/ML algorithms.\n- Offers sentiment analysis including score, comparative value, and breakdown of positive and negative sentiment.\n\nThis API eliminates the need for manual rules or site-specific training, providing an efficient solution for extracting valuable information from online articles.",
"termsOfService": "https://pipfeed.com",
"contact": {
"email": "[email protected]"
},
"version": "1.0.3"
},
"externalDocs": {
"description": "Pipfeed Parsing API Documentation",
"url": "https://pipfeed.com/docs"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/pipfeed/parse"
}
],
"paths": {
"pipfeed/parse/extract": {
"post": {
"summary": "Extract information from a URL",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"url": {
"type": "string",
"example": "https://techcrunch.com/2022/04/18/web-scraping-legal-court/"
}
},
"required": [
"url"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"title": {
"type": "string"
},
"author": {
"type": "string"
},
"html": {
"type": "string"
},
"length": {
"type": "integer"
},
"description": {
"type": "string"
},
"siteName": {
"type": "string"
},
"topImage": {
"type": "string"
},
"date": {
"type": "string",
"format": "date-time"
},
"keywords": {
"type": "string"
},
"summary": {
"type": "array",
"items": {
"type": "string"
}
},
"sentiment": {
"type": "object",
"properties": {
"score": {
"type": "integer"
},
"comparative": {
"type": "number"
},
"calculation": {
"type": "array",
"items": {
"type": "object",
"properties": {
"expand": {
"type": "integer"
},
"failure": {
"type": "integer"
},
"wrong": {
"type": "integer"
}
}
}
},
"positive": {
"type": "array",
"items": {
"type": "string"
}
},
"negative": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-coder.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.1.3",
"description": "API for code generation using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/coder"
}
],
"paths": {
"magicapi/coder/predictions/{request_id}": {
"get": {
"summary": "Get coder output URL",
"description": "This endpoint retrieves the URL of the coding assistant's response for a given request ID.\n",
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"description": "Unique identifier for the request.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the prediction (e.g., \"succeeded\")."
},
"response_url": {
"type": "string",
"format": "uri",
"description": "URL of the response."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/coder/coder": {
"post": {
"summary": "Coding Assistant",
"description": "Coding Assistant. \n Make sure you call get coder output URL MCP tool to get the URL for the request id received from this API ",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"top_k": {
"type": "integer",
"default": 250
},
"top_p": {
"type": "integer",
"default": 0.95
},
"prompt": {
"type": "string",
"default": "Write a javascript function that calculates euclidean distance between two coordinates of any dimension"
},
"max_tokens": {
"type": "integer",
"default": 500
},
"temperature": {
"type": "integer",
"default": 0.95
},
"system_prompt": {
"type": "string"
},
"repeat_penalty": {
"type": "integer",
"default": 1.1
},
"presence_penalty": {
"type": "integer",
"default": 0
},
"frequency_penalty": {
"type": "integer",
"default": 0
}
},
"required": [
"top_k",
"top_p",
"prompt",
"max_tokens",
"temperature",
"system_prompt",
"repeat_penalty",
"presence_penalty",
"frequency_penalty"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/utils/LLM_summary_shortener.py:
--------------------------------------------------------------------------------
```python
import os
import glob
import yaml
import json
import logging
import requests
import re
import sys
# Set up logging with time, level, and message
logging.basicConfig(level=logging.INFO,
format='%(levelname)s - %(message)s')
def is_valid_string(s):
pattern = r'^[a-zA-Z0-9 _-]+$'
return bool(re.match(pattern, s))
def update_summary(current_summary: str, depth: int = 0) -> str:
"""
Sends a request to the Magic API using the current_summary and returns the new_summary from the response.
Parameters:
current_summary (str): The summary text to be sent as the user input.
Returns:
new_summary (str): The new summary generated by the API.
Raises:
ValueError: If the API key is not found in the environment.
requests.HTTPError: For any HTTP errors that occur during the API call.
"""
# Retrieve API key from environment variable
logging.info(
f"Initiating API call with the provided input: {current_summary}")
api_key = os.environ.get("x_magicapi_key")
if not api_key:
raise ValueError(
"API key not found. Please set the 'x_magicapi_key' environment variable.")
# API endpoint and headers
url = "https://api.magicapi.dev/api/v2/bridgeml/llm/llm/chat/completions"
headers = {
"accept": "application/json",
"x-magicapi-key": api_key,
"Content-Type": "application/json"
}
system_prompt = """
You are a technical API documentation summarizer.
Given an API endpoint summary, create a shorter version that:
1. Maintains the core functionality description
2. Is under 54 characters (including spaces)
3. Uses only alphanumeric characters, hyphens and underscores
4. Preserves technical meaning and clarity
Bad example: 'iCanSee' for 'A fast text-to-image model that makes high-quality images in 4 steps'
Good example: 'Create high-quality images from text in 4 steps'
"""
# Prepare payload with current_summary as the user message
payload = {
"messages": [
{
"role": "system",
"content": system_prompt
},
{
"role": "user",
"content": current_summary
}
],
"model": "llama-3.2-1b-preview",
"temperature": 1,
"max_tokens": 1024,
"top_p": 1,
"stream": False,
"stop": "</Output>"
}
# Make the POST request and wait for the API response
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status() # Raises an exception for HTTP error codes
# Parse the API response and extract the new summary
data = response.json()
new_summary = data["choices"][0]["message"]["content"]
if (len(new_summary) >= 55 or (not is_valid_string(new_summary))) :
logging.info(f'New summary is {new_summary}')
if(depth ==10):
logging.error('Please use manual summary shortener, the llm is unable to provide an appropriate summary, even after 10 retries')
sys.exit()
return update_summary(new_summary, depth+1)
return new_summary
# Define the HTTP methods we are interested in.
HTTP_METHODS = {"get", "post", "put", "delete",
"patch", "head", "options", "trace"}
def update_method_summaries(paths_dict, file_name):
"""
Iterate over all path entries and update the summary field in method definitions.
Logs the original summary and the updated summary.
"""
for path, methods in paths_dict.items():
if isinstance(methods, dict):
for method, operation in methods.items():
# Only target keys that represent HTTP methods (case-insensitive)
if (method.lower() in HTTP_METHODS and
isinstance(operation, dict) and
"summary" in operation and
isinstance(operation["summary"], str) and
len(operation["summary"]) >= 55):
original_summary = operation["summary"]
logging.info(
f"path '{path}', method '{method}': updating summary from '{original_summary}'")
try:
new_summary = update_summary(
current_summary=original_summary)
except Exception as e:
logging.error(f"Error updating summary for '{path}', method '{method}': {e}")
continue
logging.info(
f"path '{path}', method '{method}': updating summary to '{new_summary}'")
operation["summary"] = new_summary
# Gather all OpenAPI spec files with .yaml, .yml, or .json extensions from the current directory.
file_patterns = ["*.yaml", "*.yml", "*.json"]
files = []
script_dir = os.path.dirname(os.path.abspath(__file__))
directory = os.path.join(script_dir, "../src/lib")
for pattern in file_patterns:
search_pattern = os.path.join(directory, pattern)
files.extend(glob.glob(search_pattern))
for file in files:
logging.info(f"Opening file: {file}")
try:
with open(file, 'r') as f:
data = json.load(f) if file.endswith(".json") else yaml.safe_load(f)
logging.info(f"Finished reading file: {file}")
except Exception as e:
logging.error(f"Error reading {file}: {e}")
continue
# Only process files that have a 'paths' section.
if "paths" in data and isinstance(data["paths"], dict):
update_method_summaries(data["paths"], file)
try:
with open(file, 'w') as f:
if file.endswith(".json"):
json.dump(data, f, indent=2)
else:
yaml.dump(data, f, sort_keys=False)
logging.info(f"Finished writing (closed) file: {file}")
except Exception as e:
logging.error(f"Error writing {file}: {e}")
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-whisper.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "Image Processing API",
"version": "1.1.3",
"description": "API for sentece wise transcription and analysis of audio, using AI models."
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/whisper"
}
],
"paths": {
"magicapi/whisper/predictions/{request_id}": {
"get": {
"summary": "Get audio analysis URL",
"description": "This endpoint retrieves the URL of the transcription and analysis of the audio for the given request ID.\n",
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"description": "Unique identifier for the request.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the prediction (e.g., \"succeeded\")."
},
"response_url": {
"type": "string",
"format": "uri",
"description": "URL of the audio's transcription and analysis."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/whisper/whisper": {
"post": {
"summary": "Whisper Audio Processing",
"description": "API for sentece wise transcription and analysis of audio, using AI models. Make sure to call get audio analysis URL with the request ID received from this API.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"audio": {
"type": "string",
"default": "https://replicate.delivery/mgxm/e5159b1b-508a-4be4-b892-e1eb47850bdc/OSR_uk_000_0050_8k.wav"
},
"model": {
"type": "string",
"default": "large-v3"
},
"translate": {
"type": "boolean",
"default": false
},
"temperature": {
"type": "integer",
"default": 0
},
"transcription": {
"type": "string",
"default": "plain text"
},
"suppress_tokens": {
"type": "string",
"default": -1
},
"logprob_threshold": {
"type": "integer",
"default": -1
},
"no_speech_threshold": {
"type": "integer",
"default": 0.6
},
"condition_on_previous_text": {
"type": "boolean",
"default": true
},
"compression_ratio_threshold": {
"type": "integer",
"default": 2.4
},
"temperature_increment_on_fallback": {
"type": "integer",
"default": 0.2
}
},
"required": [
"audio",
"model",
"translate",
"temperature",
"transcription",
"suppress_tokens",
"logprob_threshold",
"no_speech_threshold",
"condition_on_previous_text",
"compression_ratio_threshold",
"temperature_increment_on_fallback"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"request_id": {
"type": "string",
"description": "Unique identifier for the request."
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error."
}
}
}
}
}
}
},
"security": [
{
"apiKey": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_trueway-matrix.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.1",
"info": {
"title": "TrueWay Matrix API V1",
"description": "Calculate distances and driving durations between a set of origins and destinations on the real road network",
"contact": {
"name": "TrueWay Team",
"url": "https://truewayapi.com/",
"email": "[email protected]"
},
"version": "v1"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/trueway/matrix"
}
],
"paths": {
"trueway/matrix/MatrixService/CalculateDrivingMatrix": {
"get": {
"tags": [
"MatrixService"
],
"summary": "distance and duration bw starts and stops",
"description": "Calculate length and driving time of the optimal routes between origin and destination points on the real road network.",
"parameters": [
{
"name": "origins",
"in": "query",
"description": "List of origins described as semicolon-delimited coordinate pairs with latitudes and longitudes. Maximum 25 pairs per request.",
"required": true,
"schema": {
"type": "string"
},
"example": "40.629041,-74.025606;40.630099,-73.993521;40.644895,-74.013818;40.627177,-73.980853"
},
{
"name": "destinations",
"in": "query",
"description": "List of destinations described as semicolon-delimited coordinate pairs with latitudes and longitudes. If not specified, an n x n matrix will be generated using the origins. Maximum 25 pairs per request.",
"schema": {
"type": "string"
},
"example": "40.629041,-74.025606;40.630099,-73.993521;40.644895,-74.013818;40.627177,-73.980853"
},
{
"name": "avoid_tolls",
"in": "query",
"description": "Avoid tolls",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "avoid_highways",
"in": "query",
"description": "Avoid highways",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "avoid_ferries",
"in": "query",
"description": "Avoid ferries",
"schema": {
"type": "boolean",
"default": false
}
},
{
"name": "start_time",
"in": "query",
"description": "Time when travel is expected to start. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC or you can use 'now' to specify the current time.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"required": [
"distances",
"durations"
],
"type": "object",
"properties": {
"distances": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
}
},
"description": "An array of distances(in meters) between origins and destinations locations"
},
"durations": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
}
},
"description": "An array of durations(in seconds) between origins and destinations locations"
}
},
"additionalProperties": false
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"required": [
"error"
],
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
}
}
}
},
"500": {
"description": "Server Error",
"content": {
"application/json": {
"schema": {
"required": [
"error"
],
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
}
}
}
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"DistanceMatrixResponse": {
"required": [
"distances",
"durations"
],
"type": "object",
"properties": {
"distances": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
}
},
"description": "An array of distances(in meters) between origins and destinations locations"
},
"durations": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
}
},
"description": "An array of durations(in seconds) between origins and destinations locations"
}
},
"additionalProperties": false
},
"FaultResponse": {
"required": [
"error"
],
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
}
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_magicapi-pdf-extract.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.0",
"info": {
"title": "PDF to Text/HTML API",
"description": "Convert PDF to Text/HTML API",
"version": "1.0.2"
},
"paths": {
"magicapi/pdf!extract/pdf_to_html_url/": {
"post": {
"summary": "Convert PDF to HTML from URL",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"pdf_url": {
"type": "string",
"format": "uri",
"description": "URL of the PDF file to convert",
"example": "https://www.sbs.ox.ac.uk/sites/default/files/2019-01/cv-template.pdf"
}
}
}
}
}
},
"responses": {
"200": {
"description": "HTML content generated from the PDF",
"content": {
"text/html": {
"schema": {
"type": "string",
"description": "HTML content generated from the PDF"
}
}
}
},
"400": {
"description": "Bad request"
},
"500": {
"description": "Internal server error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/pdf!extract/pdf_to_text_url/": {
"post": {
"summary": "Convert PDF to Text from URL",
"description": "Converts a PDF file located at the provided URL to plain text.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"pdf_url": {
"type": "string",
"description": "URL of the PDF file to convert",
"example": "https://www.sbs.ox.ac.uk/sites/default/files/2019-01/cv-template.pdf"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Plain text extracted from the PDF file from given URL"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error"
}
}
}
}
}
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/pdf!extract/pdf_to_text_file/": {
"post": {
"summary": "Convert PDF to Text from File",
"description": "Converts a PDF file uploaded as form data to plain text.",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"pdf_file": {
"type": "string",
"format": "binary",
"description": "PDF file to convert"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Plain text extracted from the PDF file"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error"
}
}
}
}
}
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"magicapi/pdf!extract/pdf_to_html_file/": {
"post": {
"summary": "Convert PDF to HTML from File",
"description": "Converts a PDF file uploaded as form data to HTML.",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"properties": {
"pdf_file": {
"type": "string",
"format": "binary",
"description": "PDF file to convert"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"html": {
"type": "string",
"description": "HTML content generated from the PDF file"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Description of the error"
}
}
}
}
}
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/magicapi/pdf-extract"
}
],
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/APIMarketMCPServer.ts:
--------------------------------------------------------------------------------
```typescript
import axios from "axios";
import fs from "fs";
import readline from "readline";
import path from "path";
import { fileURLToPath } from "url";
import { dirname } from "path";
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { OpenAPIV3 } from "openapi-types";
import {
ListToolsRequestSchema,
CallToolRequestSchema,
Tool,
} from "@modelcontextprotocol/sdk/types.js";
import { APIMarketMCPServerConfig } from "./utils.js";
import { readFile } from "fs/promises";
// Define __dirname for ESM compatibility
const __dirname = dirname(fileURLToPath(import.meta.url));
export class APIMarketMCPServer {
private server: Server;
private config: APIMarketMCPServerConfig;
private tools: Map<string, Tool> = new Map();
private headers: Map<string, string> = new Map();
constructor(config: APIMarketMCPServerConfig) {
this.config = config;
this.server = new Server({
name: config.name,
version: config.version,
});
this.initializeHandlers();
}
private async loadOpenAPISpec(file_path: string): Promise<OpenAPIV3.Document> {
if (typeof file_path === "string") {
if (file_path.startsWith("http")) {
// Load from URL
const response = await axios.get(file_path);
return response.data as OpenAPIV3.Document;
} else {
// Load from local file
const content = await readFile(file_path, "utf-8");
return JSON.parse(content) as OpenAPIV3.Document;
}
}
if (typeof file_path === "object" && file_path !== null) {
return file_path as OpenAPIV3.Document;
}
throw new Error("Invalid OpenAPI specification format");
}
private async listOfFilePaths(): Promise<string[]> {
const lines = [];
try {
const fileStream = fs.createReadStream(this.config.openApiSpec);
const rl = readline.createInterface({
input: fileStream,
crlfDelay: Infinity
});
for await (const line of rl) {
lines.push(line);
}
return lines; // Return the array of lines
} catch (error) {
console.error(`Error reading file paths from ${this.config.openApiSpec}:`, error);
throw new Error(`Failed to read API specifications list: ${error.message}`);
}
}
private async parseOpenAPISpec(): Promise<void> {
const paths = await this.listOfFilePaths()
for (const cur_path of paths) {
if (!cur_path || cur_path.trim() === '') {
console.error('Skipping empty path');
continue;
}
try {
const spec = await this.loadOpenAPISpec(path.resolve(__dirname, cur_path));
// Convert each OpenAPI path to an MCP tool
for (const [path, pathItem] of Object.entries(spec.paths)) {
if (!pathItem) continue;
for (const [method, operation] of Object.entries(pathItem)) {
if (method === "parameters" || !operation) continue;
const op = operation as OpenAPIV3.OperationObject;
// Create a clean tool ID by removing the leading slash and replacing special chars
const cleanPath = path.replace(/^\//, "");
const toolId = `${method.toUpperCase()}-${cleanPath}`.replace(
/[^a-zA-Z0-9-_]/g,
"-",
);
const tool: Tool = {
name:
(op.operationId || op.summary || `${method.toUpperCase()} ${path}`).replace(/\s+/g, "_"),
description:
op.description ||
`Make a ${method.toUpperCase()} request to ${path}`,
inputSchema: {
type: "object",
properties: {},
// Add any additional properties from OpenAPI spec
},
};
// Add parameters from operation
if (op.parameters) {
for (const param of op.parameters) {
if ("name" in param && "in" in param) {
const paramSchema = param.schema as OpenAPIV3.SchemaObject;
tool.inputSchema.properties[param.name] = {
type: paramSchema.type || "string",
description: param.description || `${param.name} parameter`,
};
if (param.required) {
tool.inputSchema.required = tool.inputSchema.required || [];
tool.inputSchema.required.push(param.name);
}
}
}
}
// Add request body if present (for POST, PUT, etc.)
if (op.requestBody) {
const requestBody = op.requestBody as OpenAPIV3.RequestBodyObject;
const content = requestBody.content;
// Usually we'd look for application/json content type
if (content?.['application/json']) {
this.headers.set(toolId, 'application/json');
const jsonSchema = content['application/json'].schema as OpenAPIV3.SchemaObject;
// If it's a reference, we'd need to resolve it
// For simplicity, assuming it's an inline schema
if (jsonSchema.properties) {
// Add all properties from the request body schema
for (const [propName, propSchema] of Object.entries(jsonSchema.properties)) {
tool.inputSchema.properties[propName] = propSchema;
}
// Add required properties if defined
if (jsonSchema.required) {
tool.inputSchema.required = tool.inputSchema.required || [];
tool.inputSchema.required.push(...jsonSchema.required);
}
}
}
else if (content?.['application/x-www-form-urlencoded']) {
this.headers.set(toolId, 'application/x-www-form-urlencoded');
const urlencodedSchema = content['application/x-www-form-urlencoded'].schema as OpenAPIV3.SchemaObject;
if (urlencodedSchema.properties) {
for (const [propName, propSchema] of Object.entries(urlencodedSchema.properties)) {
tool.inputSchema.properties[propName] = propSchema;
}
if (urlencodedSchema.required) {
tool.inputSchema.required = tool.inputSchema.required || [];
tool.inputSchema.required.push(...urlencodedSchema.required);
}
}
}
}
this.tools.set(toolId, tool);
}
}
} catch (error) {
console.error(`Error parsing OpenAPI spec from ${cur_path}:`, error);
}
}
}
private initializeHandlers(): void {
// Handle tool listing
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: Array.from(this.tools.values()),
};
});
// Handle tool execution
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
const { id, name, arguments: params } = request.params;
console.error("Received request:", request.params);
console.error("Using parameters from arguments:", params);
// Find tool by ID or name
let tool: Tool | undefined;
let toolId: string | undefined;
if (id) {
toolId = id.trim();
tool = this.tools.get(toolId);
} else if (name) {
// Search for tool by name
for (const [tid, t] of this.tools.entries()) {
if (t.name === name) {
tool = t;
toolId = tid;
break;
}
}
}
if (!tool || !toolId) {
console.error(
`Available tools: ${Array.from(this.tools.entries())
.map(([id, t]) => `${id} (${t.name})`)
.join(", ")}`,
);
throw new Error(`Tool not found: ${id || name}`);
}
console.error(`Executing tool: ${toolId} (${tool.name})`);
try {
// Extract method and path from tool ID
const [method, ...pathParts] = toolId.split("-");
let path = "/" + pathParts.join("/")
.replace(/-/g, "/")
.replaceAll('!', "-");
// Ensure base URL ends with slash for proper joining
const baseUrl = this.config.apiBaseUrl.endsWith("/")
? this.config.apiBaseUrl
: `${this.config.apiBaseUrl}/`;
// Remove leading slash from path to avoid double slashes
const cleanPath = path.startsWith("/") ? path.slice(1) : path;
let url;
try {
// Validate that the path results in a valid URL
// Construct the full URL
url = new URL(cleanPath, baseUrl).toString();
} catch (error) {
throw new Error(`Invalid path generated from tool ID ${toolId}: ${error.message}`);
}
// Prepare request configuration
this.config.headers = this.config.headers || {};
const contentType = this.headers.get(toolId);
if (contentType) {
this.config.headers['Content-Type'] = contentType;
}
const config: any = {
method: method.toLowerCase(),
url: url,
headers: this.config.headers,
};
// Handle different parameter types based on HTTP method
if (method.toLowerCase() === "get") {
// For GET requests, ensure parameters are properly structured
if (params && typeof params === "object") {
// Handle array parameters properly
const queryParams: Record<string, string> = {};
for (const [key, value] of Object.entries(params)) {
if (Array.isArray(value)) {
// Join array values with commas for query params
queryParams[key] = value.join(",");
} else if (value !== undefined && value !== null) {
// Convert other values to strings
queryParams[key] = String(value);
}
}
config.params = queryParams;
}
} else {
// For POST, PUT, PATCH - send as body
config.data = params;
}
console.error("Final request config:", config);
try {
const response = await axios(config);
return {
content: [{
type: "text",
text: JSON.stringify(response.data, null, 2)
}]
};
} catch (error) {
if (axios.isAxiosError(error)) {
console.error("Request failed:", {
status: error.response?.status,
statusText: error.response?.statusText,
data: error.response?.data,
headers: error.response?.headers,
});
throw new Error(
`API request failed: ${error.message} - ${JSON.stringify(error.response?.data)}`,
);
}
throw error;
}
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(`API request failed: ${error.message}`);
}
throw error;
}
});
}
async start(): Promise<void> {
await this.parseOpenAPISpec();
const transport = new StdioServerTransport();
await this.server.connect(transport);
console.error("OpenAPI MCP Server running on stdio");
}
}
```
--------------------------------------------------------------------------------
/src/lib/modified_capix-free.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.1.0",
"info": {
"title": "Content Detector API",
"version": "0.1.1"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/capix/free"
}
],
"paths": {
"capix/free/detector/v1/": {
"post": {
"tags": [
"ContentDetectorAI"
],
"summary": "Content Detector Ai",
"operationId": "ContentDetectorAI",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"content": {
"type": "string",
"title": "Content",
"default": "ContentDetector.AI is an accurate and free AI Detector and AI Content Detector that can be used to detect any AI-generated content. It provides a probability score based on the likelihood that the text content was generated by AI tools or chatbots."
}
},
"required": [
"content"
],
"title": "Body"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"Body_BookTitleGenerator": {
"properties": {
"description": {
"type": "string",
"title": "Description",
"default": "let us dive"
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Creative`, `Formal`, `Simple`",
"default": "Formal"
}
},
"required": [
"description",
"mode"
],
"type": "object",
"title": "Body_BookTitleGenerator"
},
"Body_ContentDetectorAI": {
"properties": {
"content": {
"type": "string",
"title": "Content",
"default": "ContentDetector.AI is an accurate and free AI Detector and AI Content Detector that can be used to detect any AI-generated content. It provides a probability score based on the likelihood that the text content was generated by AI tools or chatbots."
}
},
"required": [
"content"
],
"type": "object",
"title": "Body_ContentDetectorAI"
},
"Body_EssayGenerator": {
"properties": {
"description": {
"type": "string",
"title": "Description",
"default": "Essay Topic: The Impact of Social Media on Human Communication\n\n\nKey Details and Questions:\n\n\nIntroduction: Introduce the topic by highlighting the ubiquity of social media in modern life. Pose the central question: Has social media enhanced or hindered human communication?\n\n\nHistorical Perspective:\n\n\nHow did people communicate before the advent of social media?\nWhat were the key stages in the evolution of social media platforms?\nPositive Impacts of Social Media:\n\n\nHow has social media facilitated global connectivity and understanding?\nDiscuss the role of social media in democratizing content creation and information sharing.\nNegative Impacts of Social Media:\n\n\nAnalyze the potential for misinformation and echo chambers.\nExplore the effects of social media on mental health and interpersonal relationships.\nSocial Media and Business:\n\n\nHow has social media transformed business marketing and customer engagement?\nDiscuss the rise of influencer culture and its implications.\nThe Future of Social Media:\n\n\nSpeculate on the future trends in social media.\nWhat role might emerging technologies like AI and VR play in the evolution of social media?\nConclusion:\n\n\nSummarize the main points.\nReflect on the balance between the benefits and drawbacks of social media.\nProvide a personal perspective or a call to action on how to use social media responsibly.\nThemes to Explore:\n\n\nThe role of technology in shaping human interaction.\nThe balance between virtual and real-life communication.\nEthical considerations in the age of digital media."
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 1200
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Academic`, `Professional`, `Creative`, `Journalistic`",
"default": "Standard"
}
},
"required": [
"description",
"word_count",
"mode"
],
"type": "object",
"title": "Body_EssayGenerator"
},
"Body_SentenceExpander": {
"properties": {
"sentence": {
"type": "string",
"title": "Sentence",
"default": "Struggling with wordy sentences? Want to make your writing crisp and clear? We've got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!\n\n\n\n"
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 80
}
},
"required": [
"sentence",
"word_count"
],
"type": "object",
"title": "Body_SentenceExpander"
},
"Body_SentenceShortener": {
"properties": {
"sentence": {
"type": "string",
"title": "Sentence",
"default": "Struggling with wordy sentences? Want to make your writing crisp and clear? We've got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!\n\n\n\n"
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 50
}
},
"required": [
"sentence",
"word_count"
],
"type": "object",
"title": "Body_SentenceShortener"
},
"Body_StoryGenerator": {
"properties": {
"text": {
"type": "string",
"title": "Text",
"default": "Story Topic: A Time-Travel Adventure\n\n\nSetting: The story is set in both the present day and the Victorian era. The present-day setting is a bustling modern city known for its technological advancements. The Victorian setting is characterized by cobblestone streets, gas-lit lamps, and the early stages of industrialization.\n\n\nMain Characters:\n\n\nAlex: A curious and adventurous software engineer from the present day who inadvertently discovers a time-travel device.\nEliza: A resourceful and intelligent Victorian-era inventor who dreams of changing the future.\nPlot Details:\n\n\nDiscovery of the Time Machine: Alex discovers an old, mysterious device in their attic, left behind by a forgotten ancestor. Experimenting with it, they accidentally activate it and are transported to the Victorian era.\nMeeting Eliza: Alex meets Eliza, who is fascinated by the time machine and Alex's futuristic knowledge. Together, they explore the possibilities of time travel.\nA Threat Emerges: A sinister figure from the Victorian era learns about the time machine and wants to use it for nefarious purposes, threatening both the past and the future.\nRace Against Time: Alex and Eliza must work together to safeguard the time machine and prevent the alteration of history. They face challenges in both eras, blending elements of Victorian society with futuristic technology.\nResolution: The story concludes with a thrilling confrontation, and a decision that affects both characters' destinies.\nThemes: The story explores themes of adventure, the ethics of time travel, the impact of technology on society, and the timeless nature of human curiosity and ambition."
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 1200
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Creative`, `Complex`, `Simple`",
"default": "Creative"
}
},
"required": [
"text",
"word_count",
"mode"
],
"type": "object",
"title": "Body_StoryGenerator"
},
"ServerError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
},
"ValidationError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
},
"ValueError": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_capix-shortener.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.1.0",
"info": {
"title": "Content Detector API",
"version": "0.1.1"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/capix/shortener"
}
],
"paths": {
"capix/shortener/sentence/shortener/v1/": {
"post": {
"tags": [
"SentenceShortener"
],
"summary": "Sentence Shortener",
"operationId": "SentenceShortener",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"sentence": {
"type": "string",
"title": "Sentence",
"default": "Struggling with wordy sentences? Want to make your writing crisp and clear? We've got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!\n\n\n\n"
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 50
}
},
"required": [
"word_count",
"sentence"
],
"title": "Body"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"Body_BookTitleGenerator": {
"properties": {
"description": {
"type": "string",
"title": "Description",
"default": "let us dive"
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Creative`, `Formal`, `Simple`",
"default": "Formal"
}
},
"required": [
"description",
"mode"
],
"type": "object",
"title": "Body_BookTitleGenerator"
},
"Body_ContentDetectorAI": {
"properties": {
"content": {
"type": "string",
"title": "Content",
"default": "ContentDetector.AI is an accurate and free AI Detector and AI Content Detector that can be used to detect any AI-generated content. It provides a probability score based on the likelihood that the text content was generated by AI tools or chatbots."
}
},
"required": [
"content"
],
"type": "object",
"title": "Body_ContentDetectorAI"
},
"Body_EssayGenerator": {
"properties": {
"description": {
"type": "string",
"title": "Description",
"default": "Essay Topic: The Impact of Social Media on Human Communication\n\n\nKey Details and Questions:\n\n\nIntroduction: Introduce the topic by highlighting the ubiquity of social media in modern life. Pose the central question: Has social media enhanced or hindered human communication?\n\n\nHistorical Perspective:\n\n\nHow did people communicate before the advent of social media?\nWhat were the key stages in the evolution of social media platforms?\nPositive Impacts of Social Media:\n\n\nHow has social media facilitated global connectivity and understanding?\nDiscuss the role of social media in democratizing content creation and information sharing.\nNegative Impacts of Social Media:\n\n\nAnalyze the potential for misinformation and echo chambers.\nExplore the effects of social media on mental health and interpersonal relationships.\nSocial Media and Business:\n\n\nHow has social media transformed business marketing and customer engagement?\nDiscuss the rise of influencer culture and its implications.\nThe Future of Social Media:\n\n\nSpeculate on the future trends in social media.\nWhat role might emerging technologies like AI and VR play in the evolution of social media?\nConclusion:\n\n\nSummarize the main points.\nReflect on the balance between the benefits and drawbacks of social media.\nProvide a personal perspective or a call to action on how to use social media responsibly.\nThemes to Explore:\n\n\nThe role of technology in shaping human interaction.\nThe balance between virtual and real-life communication.\nEthical considerations in the age of digital media."
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 1200
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Academic`, `Professional`, `Creative`, `Journalistic`",
"default": "Standard"
}
},
"required": [
"description",
"word_count",
"mode"
],
"type": "object",
"title": "Body_EssayGenerator"
},
"Body_SentenceExpander": {
"properties": {
"sentence": {
"type": "string",
"title": "Sentence",
"default": "Struggling with wordy sentences? Want to make your writing crisp and clear? We've got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!\n\n\n\n"
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 80
}
},
"required": [
"sentence",
"word_count"
],
"type": "object",
"title": "Body_SentenceExpander"
},
"Body_SentenceShortener": {
"properties": {
"sentence": {
"type": "string",
"title": "Sentence",
"default": "Struggling with wordy sentences? Want to make your writing crisp and clear? We've got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!\n\n\n\n"
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 50
}
},
"required": [
"sentence",
"word_count"
],
"type": "object",
"title": "Body_SentenceShortener"
},
"Body_StoryGenerator": {
"properties": {
"text": {
"type": "string",
"title": "Text",
"default": "Story Topic: A Time-Travel Adventure\n\n\nSetting: The story is set in both the present day and the Victorian era. The present-day setting is a bustling modern city known for its technological advancements. The Victorian setting is characterized by cobblestone streets, gas-lit lamps, and the early stages of industrialization.\n\n\nMain Characters:\n\n\nAlex: A curious and adventurous software engineer from the present day who inadvertently discovers a time-travel device.\nEliza: A resourceful and intelligent Victorian-era inventor who dreams of changing the future.\nPlot Details:\n\n\nDiscovery of the Time Machine: Alex discovers an old, mysterious device in their attic, left behind by a forgotten ancestor. Experimenting with it, they accidentally activate it and are transported to the Victorian era.\nMeeting Eliza: Alex meets Eliza, who is fascinated by the time machine and Alex's futuristic knowledge. Together, they explore the possibilities of time travel.\nA Threat Emerges: A sinister figure from the Victorian era learns about the time machine and wants to use it for nefarious purposes, threatening both the past and the future.\nRace Against Time: Alex and Eliza must work together to safeguard the time machine and prevent the alteration of history. They face challenges in both eras, blending elements of Victorian society with futuristic technology.\nResolution: The story concludes with a thrilling confrontation, and a decision that affects both characters' destinies.\nThemes: The story explores themes of adventure, the ethics of time travel, the impact of technology on society, and the timeless nature of human curiosity and ambition."
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 1200
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Creative`, `Complex`, `Simple`",
"default": "Creative"
}
},
"required": [
"text",
"word_count",
"mode"
],
"type": "object",
"title": "Body_StoryGenerator"
},
"ServerError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
},
"ValidationError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
},
"ValueError": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_capix-story.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.1.0",
"info": {
"title": "Content Detector API",
"version": "0.1.1"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/capix/story"
}
],
"paths": {
"capix/story/generate/story/v1/": {
"post": {
"tags": [
"StoryGenerator"
],
"summary": "Story Generator",
"operationId": "StoryGenerator",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"title": "Text",
"default": "Story Topic: A Time-Travel Adventure\n\n\nSetting: The story is set in both the present day and the Victorian era. The present-day setting is a bustling modern city known for its technological advancements. The Victorian setting is characterized by cobblestone streets, gas-lit lamps, and the early stages of industrialization.\n\n\nMain Characters:\n\n\nAlex: A curious and adventurous software engineer from the present day who inadvertently discovers a time-travel device.\nEliza: A resourceful and intelligent Victorian-era inventor who dreams of changing the future.\nPlot Details:\n\n\nDiscovery of the Time Machine: Alex discovers an old, mysterious device in their attic, left behind by a forgotten ancestor. Experimenting with it, they accidentally activate it and are transported to the Victorian era.\nMeeting Eliza: Alex meets Eliza, who is fascinated by the time machine and Alex's futuristic knowledge. Together, they explore the possibilities of time travel.\nA Threat Emerges: A sinister figure from the Victorian era learns about the time machine and wants to use it for nefarious purposes, threatening both the past and the future.\nRace Against Time: Alex and Eliza must work together to safeguard the time machine and prevent the alteration of history. They face challenges in both eras, blending elements of Victorian society with futuristic technology.\nResolution: The story concludes with a thrilling confrontation, and a decision that affects both characters' destinies.\nThemes: The story explores themes of adventure, the ethics of time travel, the impact of technology on society, and the timeless nature of human curiosity and ambition."
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 1200
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Creative`, `Complex`, `Simple`",
"default": "Creative"
}
},
"required": [
"text",
"mode",
"word_count"
],
"title": "Body"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"Body_BookTitleGenerator": {
"properties": {
"description": {
"type": "string",
"title": "Description",
"default": "let us dive"
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Creative`, `Formal`, `Simple`",
"default": "Formal"
}
},
"required": [
"description",
"mode"
],
"type": "object",
"title": "Body_BookTitleGenerator"
},
"Body_ContentDetectorAI": {
"properties": {
"content": {
"type": "string",
"title": "Content",
"default": "ContentDetector.AI is an accurate and free AI Detector and AI Content Detector that can be used to detect any AI-generated content. It provides a probability score based on the likelihood that the text content was generated by AI tools or chatbots."
}
},
"required": [
"content"
],
"type": "object",
"title": "Body_ContentDetectorAI"
},
"Body_EssayGenerator": {
"properties": {
"description": {
"type": "string",
"title": "Description",
"default": "Essay Topic: The Impact of Social Media on Human Communication\n\n\nKey Details and Questions:\n\n\nIntroduction: Introduce the topic by highlighting the ubiquity of social media in modern life. Pose the central question: Has social media enhanced or hindered human communication?\n\n\nHistorical Perspective:\n\n\nHow did people communicate before the advent of social media?\nWhat were the key stages in the evolution of social media platforms?\nPositive Impacts of Social Media:\n\n\nHow has social media facilitated global connectivity and understanding?\nDiscuss the role of social media in democratizing content creation and information sharing.\nNegative Impacts of Social Media:\n\n\nAnalyze the potential for misinformation and echo chambers.\nExplore the effects of social media on mental health and interpersonal relationships.\nSocial Media and Business:\n\n\nHow has social media transformed business marketing and customer engagement?\nDiscuss the rise of influencer culture and its implications.\nThe Future of Social Media:\n\n\nSpeculate on the future trends in social media.\nWhat role might emerging technologies like AI and VR play in the evolution of social media?\nConclusion:\n\n\nSummarize the main points.\nReflect on the balance between the benefits and drawbacks of social media.\nProvide a personal perspective or a call to action on how to use social media responsibly.\nThemes to Explore:\n\n\nThe role of technology in shaping human interaction.\nThe balance between virtual and real-life communication.\nEthical considerations in the age of digital media."
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 1200
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Academic`, `Professional`, `Creative`, `Journalistic`",
"default": "Standard"
}
},
"required": [
"description",
"word_count",
"mode"
],
"type": "object",
"title": "Body_EssayGenerator"
},
"Body_SentenceExpander": {
"properties": {
"sentence": {
"type": "string",
"title": "Sentence",
"default": "Struggling with wordy sentences? Want to make your writing crisp and clear? We've got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!\n\n\n\n"
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 80
}
},
"required": [
"sentence",
"word_count"
],
"type": "object",
"title": "Body_SentenceExpander"
},
"Body_SentenceShortener": {
"properties": {
"sentence": {
"type": "string",
"title": "Sentence",
"default": "Struggling with wordy sentences? Want to make your writing crisp and clear? We've got you covered! Introducing Sentence Shortener, the perfect free tool to help you cut down on those extra words. No more headaches over long, complicated sentences. With our AI, you can make your writing easy to read and understand - in just a few clicks!\n\n\n\n"
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 50
}
},
"required": [
"sentence",
"word_count"
],
"type": "object",
"title": "Body_SentenceShortener"
},
"Body_StoryGenerator": {
"properties": {
"text": {
"type": "string",
"title": "Text",
"default": "Story Topic: A Time-Travel Adventure\n\n\nSetting: The story is set in both the present day and the Victorian era. The present-day setting is a bustling modern city known for its technological advancements. The Victorian setting is characterized by cobblestone streets, gas-lit lamps, and the early stages of industrialization.\n\n\nMain Characters:\n\n\nAlex: A curious and adventurous software engineer from the present day who inadvertently discovers a time-travel device.\nEliza: A resourceful and intelligent Victorian-era inventor who dreams of changing the future.\nPlot Details:\n\n\nDiscovery of the Time Machine: Alex discovers an old, mysterious device in their attic, left behind by a forgotten ancestor. Experimenting with it, they accidentally activate it and are transported to the Victorian era.\nMeeting Eliza: Alex meets Eliza, who is fascinated by the time machine and Alex's futuristic knowledge. Together, they explore the possibilities of time travel.\nA Threat Emerges: A sinister figure from the Victorian era learns about the time machine and wants to use it for nefarious purposes, threatening both the past and the future.\nRace Against Time: Alex and Eliza must work together to safeguard the time machine and prevent the alteration of history. They face challenges in both eras, blending elements of Victorian society with futuristic technology.\nResolution: The story concludes with a thrilling confrontation, and a decision that affects both characters' destinies.\nThemes: The story explores themes of adventure, the ethics of time travel, the impact of technology on society, and the timeless nature of human curiosity and ambition."
},
"word_count": {
"type": "integer",
"title": "Word Count",
"default": 1200
},
"mode": {
"type": "string",
"title": "Mode",
"description": "`Standard`, `Creative`, `Complex`, `Simple`",
"default": "Creative"
}
},
"required": [
"text",
"word_count",
"mode"
],
"type": "object",
"title": "Body_StoryGenerator"
},
"ServerError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
},
"ValidationError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
},
"ValueError": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_brave-brave.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.0.1",
"info": {
"title": "Brave Search API",
"description": "API for accessing various search functionalities in Brave Search",
"version": "1.0.0"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/brave/brave"
}
],
"paths": {
"brave/brave/videos/search": {
"get": {
"summary": "Search Videos",
"description": "Retrieve video search results based on query parameters",
"parameters": [
{
"name": "q",
"in": "query",
"required": true,
"description": "Search query",
"schema": {
"type": "string"
}
},
{
"name": "count",
"in": "query",
"required": false,
"description": "Number of results to return",
"schema": {
"type": "integer",
"default": 10
}
},
{
"name": "country",
"in": "query",
"required": false,
"description": "Country code",
"schema": {
"type": "string",
"default": "us"
}
},
{
"name": "search_lang",
"in": "query",
"required": false,
"description": "Search language",
"schema": {
"type": "string",
"default": "en"
}
},
{
"name": "spellcheck",
"in": "query",
"required": false,
"description": "Enable spellcheck",
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Successful video search results",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"ApiKeyAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"brave/brave/web/search": {
"get": {
"summary": "Search Web",
"description": "Retrieve web search results based on query parameters",
"parameters": [
{
"name": "q",
"in": "query",
"required": true,
"description": "Search query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful web search results",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"ApiKeyAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"brave/brave/images/search": {
"get": {
"summary": "Search Images",
"description": "Retrieve image search results based on query parameters",
"parameters": [
{
"name": "q",
"in": "query",
"required": true,
"description": "Search query",
"schema": {
"type": "string"
}
},
{
"name": "safesearch",
"in": "query",
"required": false,
"description": "Safe search filter",
"schema": {
"type": "string",
"default": "strict"
}
},
{
"name": "count",
"in": "query",
"required": false,
"description": "Number of results to return",
"schema": {
"type": "integer",
"default": 20
}
},
{
"name": "search_lang",
"in": "query",
"required": false,
"description": "Search language",
"schema": {
"type": "string",
"default": "en"
}
},
{
"name": "country",
"in": "query",
"required": false,
"description": "Country code",
"schema": {
"type": "string",
"default": "us"
}
},
{
"name": "spellcheck",
"in": "query",
"required": false,
"description": "Enable spellcheck",
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Successful image search results",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"ApiKeyAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"brave/brave/news/search": {
"get": {
"summary": "Search News",
"description": "Retrieve news search results based on query parameters",
"parameters": [
{
"name": "q",
"in": "query",
"required": true,
"description": "Search query",
"schema": {
"type": "string"
}
},
{
"name": "count",
"in": "query",
"required": false,
"description": "Number of results to return",
"schema": {
"type": "integer",
"default": 10
}
},
{
"name": "country",
"in": "query",
"required": false,
"description": "Country code",
"schema": {
"type": "string",
"default": "us"
}
},
{
"name": "search_lang",
"in": "query",
"required": false,
"description": "Search language",
"schema": {
"type": "string",
"default": "en"
}
},
{
"name": "spellcheck",
"in": "query",
"required": false,
"description": "Enable spellcheck",
"schema": {
"type": "boolean",
"default": true
}
}
],
"responses": {
"200": {
"description": "Successful news search results",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"ApiKeyAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"brave/brave/suggest/search": {
"get": {
"summary": "Search Suggestions",
"description": "Retrieve search suggestions based on query parameters",
"parameters": [
{
"name": "q",
"in": "query",
"required": true,
"description": "Search query",
"schema": {
"type": "string"
}
},
{
"name": "country",
"in": "query",
"required": false,
"description": "Country code",
"schema": {
"type": "string",
"default": "US"
}
},
{
"name": "count",
"in": "query",
"required": false,
"description": "Number of suggestions to return",
"schema": {
"type": "integer",
"default": 5
}
}
],
"responses": {
"200": {
"description": "Successful search suggestions",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"suggestions": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"ApiKeyAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"brave/brave/spellcheck/search": {
"get": {
"summary": "Spellcheck Search",
"description": "Retrieve spellcheck suggestions based on query parameters",
"parameters": [
{
"name": "q",
"in": "query",
"required": true,
"description": "Search query",
"schema": {
"type": "string"
}
},
{
"name": "country",
"in": "query",
"required": false,
"description": "Country code",
"schema": {
"type": "string",
"default": "US"
}
}
],
"responses": {
"200": {
"description": "Successful spellcheck suggestions",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"spellcheck": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
},
"security": [
{
"ApiKeyAuth": []
}
]
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"securitySchemes": {}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_capix-faceswap.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.1.0",
"info": {
"title": "FaceSwap API",
"version": "0.1.1"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/capix/faceswap"
}
],
"paths": {
"capix/faceswap/upload/": {
"post": {
"tags": [
"Upload"
],
"summary": "Upload",
"operationId": "Upload",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"schema": {
"properties": {
"file1": {
"type": "string",
"format": "binary",
"title": "File1"
}
},
"type": "object",
"required": [
"file1"
],
"title": "Body_Upload"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"capix/faceswap/faceswap/v1/image": {
"post": {
"tags": [
"FaceSwap"
],
"summary": "Face Swap Image",
"operationId": "ImageFaceSwap",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"target_url": {
"type": "string",
"title": "Target Url",
"description": "Require an image with a face",
"default": "https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg"
},
"swap_url": {
"type": "string",
"title": "Swap Url",
"description": "Require an image with a face",
"default": "https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg"
}
},
"required": [
"swap_url",
"target_url"
],
"title": "Body"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"capix/faceswap/faceswap/v1/video": {
"post": {
"tags": [
"FaceSwap"
],
"summary": "Face Swap Video",
"operationId": "VideoFaceSwap",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"target_url": {
"type": "string",
"pattern": "^.*\\.mp4$",
"title": "Target Url",
"description": "Require only .mp4 video file url",
"default": "https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4"
},
"swap_url": {
"type": "string",
"title": "Swap Url",
"description": "Require an image with a face",
"default": "https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg"
}
},
"required": [
"swap_url",
"target_url"
],
"title": "Body"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"capix/faceswap/result/": {
"post": {
"tags": [
"Get Result"
],
"summary": "Result",
"operationId": "Result",
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"properties": {
"request_id": {
"type": "string",
"title": "Request Id"
}
},
"type": "object",
"required": [
"request_id"
],
"title": "Body_Result"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"Body_ImageFaceSwap": {
"properties": {
"target_url": {
"type": "string",
"title": "Target Url",
"description": "Require an image with a face",
"default": "https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg"
},
"swap_url": {
"type": "string",
"title": "Swap Url",
"description": "Require an image with a face",
"default": "https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg"
}
},
"required": [
"target_url",
"swap_url"
],
"type": "object",
"title": "Body_ImageFaceSwap"
},
"Body_Result": {
"properties": {
"request_id": {
"type": "string",
"title": "Request Id"
}
},
"type": "object",
"required": [
"request_id"
],
"title": "Body_Result"
},
"Body_Upload": {
"properties": {
"file1": {
"type": "string",
"format": "binary",
"title": "File1"
}
},
"type": "object",
"required": [
"file1"
],
"title": "Body_Upload"
},
"Body_VideoFaceSwap": {
"properties": {
"target_url": {
"type": "string",
"pattern": "^.*\\.mp4$",
"title": "Target Url",
"description": "Require only .mp4 video file url",
"default": "https://storage.ws.pho.to/s2/7e2131eaef5e5cbb0d2c9eef7e2f19343b5a1292.mp4"
},
"swap_url": {
"type": "string",
"title": "Swap Url",
"description": "Require an image with a face",
"default": "https://storage.ws.pho.to/s2/818f3e408ee37c090cf23a3d12e15a08ada80ad9_m.jpeg"
}
},
"required": [
"target_url",
"swap_url"
],
"type": "object",
"title": "Body_VideoFaceSwap"
},
"ServerError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
},
"ValidationError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
},
"ValueError": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"security": {},
"tags": []
}
```
--------------------------------------------------------------------------------
/src/lib/modified_capix-homegpt.json:
--------------------------------------------------------------------------------
```json
{
"openapi": "3.1.0",
"info": {
"title": "RoomGPT API",
"version": "0.1.1"
},
"servers": [
{
"url": "http://api.magicapi.dev/api/v1/capix/homegpt"
}
],
"paths": {
"capix/homegpt/home/v1/": {
"post": {
"tags": [
"GPT Generative"
],
"summary": "Homegpt",
"operationId": "HomeGPT",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"image_url": {
"type": "string",
"title": "Image Url",
"default": "https://telegra.ph/file/c6c8be08bfb1e27e558a1.png"
},
"theme": {
"type": "string",
"title": "Theme",
"description": "Themes could be one of these: `Modern`, `Neutral`, `Monochromatic`, `Complementary`, `Cyberpunk`, `Analogous`, `Warm`, `Cool`, `Pastel`, `Black and white`, `Earthy`, `Vintage`, `Minimalist`, `Scandinavian`, `Bohemian`, `High-Contrast`, `Bright`, `Ocean-inspired`, `Rustic`, `Tropical`, `Bold`, `Jewel-toned`, `Art Deco`, `Mediterranean`, `Traditional`, `Beachy`, `Moody`, `Urban`, `Contemporary`, `Retro`, `Whimsical`, `Zen`, `Industrial`, `Biophilic`, `Farmhouse`, `Japanese Design`, `Coastal`, `Cottagecore`, `French Country`, `Maximalist`, `Art Nouveau`, `Baroque`, `Vaporwave`, `Ski Chalet`, `Sketch`, `Christmas`, `Tribal`, `Medieval`, `Chinese New Year`, `Halloween`, `Kelly Wearstler`, `Nate Berkus`, `Joanna Gaines`, `Martyn Lawrence Bullard`, `Philippe Starck`, `Emily Henderson`, `Miles Redd`, `Victoria Hagan`, `Tom Dixon`, `Timothy Corrigan`, `Axel Vervoordt`, `Kelly Hoppen`, `Ilse Crawford`, `India Mahdavi`, `David Collins`, `Thomas O'Brien`, `Jacques Garcia`, `Bunny Williams`, `Kelly Behun`, `Robert Couturier`",
"default": "Modern"
}
},
"required": [],
"title": "Body"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"capix/homegpt/room/v1/": {
"post": {
"tags": [
"GPT Generative"
],
"summary": "Roomgpt",
"operationId": "RoomGPT",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"image_url": {
"type": "string",
"title": "Image Url",
"default": "https://telegra.ph/file/c6c8be08bfb1e27e558a1.png"
},
"room": {
"type": "string",
"title": "Room",
"description": "Room names could be one of these: `Living Room`, `Dining Room`, `Gaming Room`, `Bedroom`, `Bathroom`, `Office`, `Kitchen`, `Guest Room`, `Laundry Room`, `Home Theater`, `Playroom`, `Music Room`, `Exercise Room`, `Library`, `Sunroom`, `Mudroom`, `Attic`, `Basement`, `Pantry`, `Wine Cellar`, `Garage`, `Outdoor Living Space`, `Pool Room`, `Study Room`, `Home Office`, `House Exterior`, `Outdoor Pool Area`, `Outdoor Patio`, `Outdoor Garden`, `Meeting Room`, `Workshop`, `Fitness Gym`, `Coffee Shop`, `Clothing Store`, `Walk-in Closet`, `Toilet`, `Restaurant`, `Coworking Space`, `Hotel Lobby`, `Hotel Room`, `Hotel Bathroom`, `Exhibition Space`, `Onsen`, `Drop Zone`",
"default": "Living room"
},
"theme": {
"type": "string",
"title": "Theme",
"description": "Themes could be one of these: `Modern`, `Neutral`, `Monochromatic`, `Complementary`, `Cyberpunk`, `Analogous`, `Warm`, `Cool`, `Pastel`, `Black and white`, `Earthy`, `Vintage`, `Minimalist`, `Scandinavian`, `Bohemian`, `High-Contrast`, `Bright`, `Ocean-inspired`, `Rustic`, `Tropical`, `Bold`, `Jewel-toned`, `Art Deco`, `Mediterranean`, `Traditional`, `Beachy`, `Moody`, `Urban`, `Contemporary`, `Retro`, `Whimsical`, `Zen`, `Industrial`, `Biophilic`, `Farmhouse`, `Japanese Design`, `Coastal`, `Cottagecore`, `French Country`, `Maximalist`, `Art Nouveau`, `Baroque`, `Vaporwave`, `Ski Chalet`, `Sketch`, `Christmas`, `Tribal`, `Medieval`, `Chinese New Year`, `Halloween`, `Kelly Wearstler`, `Nate Berkus`, `Joanna Gaines`, `Martyn Lawrence Bullard`, `Philippe Starck`, `Emily Henderson`, `Miles Redd`, `Victoria Hagan`, `Tom Dixon`, `Timothy Corrigan`, `Axel Vervoordt`, `Kelly Hoppen`, `Ilse Crawford`, `India Mahdavi`, `David Collins`, `Thomas O'Brien`, `Jacques Garcia`, `Bunny Williams`, `Kelly Behun`, `Robert Couturier`",
"default": "Modern"
}
},
"required": [],
"title": "Body"
}
}
}
},
"responses": {
"202": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"capix/homegpt/result/": {
"post": {
"tags": [
"Get Result"
],
"summary": "Homegpt",
"operationId": "Result",
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"properties": {
"request_id": {
"type": "string",
"title": "Request Id"
}
},
"type": "object",
"required": [
"request_id"
],
"title": "Body_Result"
}
}
}
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"400": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"description": "Bad Request"
},
"422": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
}
}
},
"description": "Internal Server Error"
}
}
},
"parameters": [
{
"description": "API.market API Key",
"in": "header",
"name": "x-magicapi-key",
"value": "clp7flnx6000j3pifm3pinw92",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"Body_HomeGPT": {
"properties": {
"image_url": {
"type": "string",
"title": "Image Url",
"default": "https://telegra.ph/file/c6c8be08bfb1e27e558a1.png"
},
"theme": {
"type": "string",
"title": "Theme",
"description": "Themes could be one of these: `Modern`, `Neutral`, `Monochromatic`, `Complementary`, `Cyberpunk`, `Analogous`, `Warm`, `Cool`, `Pastel`, `Black and white`, `Earthy`, `Vintage`, `Minimalist`, `Scandinavian`, `Bohemian`, `High-Contrast`, `Bright`, `Ocean-inspired`, `Rustic`, `Tropical`, `Bold`, `Jewel-toned`, `Art Deco`, `Mediterranean`, `Traditional`, `Beachy`, `Moody`, `Urban`, `Contemporary`, `Retro`, `Whimsical`, `Zen`, `Industrial`, `Biophilic`, `Farmhouse`, `Japanese Design`, `Coastal`, `Cottagecore`, `French Country`, `Maximalist`, `Art Nouveau`, `Baroque`, `Vaporwave`, `Ski Chalet`, `Sketch`, `Christmas`, `Tribal`, `Medieval`, `Chinese New Year`, `Halloween`, `Kelly Wearstler`, `Nate Berkus`, `Joanna Gaines`, `Martyn Lawrence Bullard`, `Philippe Starck`, `Emily Henderson`, `Miles Redd`, `Victoria Hagan`, `Tom Dixon`, `Timothy Corrigan`, `Axel Vervoordt`, `Kelly Hoppen`, `Ilse Crawford`, `India Mahdavi`, `David Collins`, `Thomas O'Brien`, `Jacques Garcia`, `Bunny Williams`, `Kelly Behun`, `Robert Couturier`",
"default": "Modern"
}
},
"type": "object",
"title": "Body_HomeGPT"
},
"Body_Result": {
"properties": {
"request_id": {
"type": "string",
"title": "Request Id"
}
},
"type": "object",
"required": [
"request_id"
],
"title": "Body_Result"
},
"Body_RoomGPT": {
"properties": {
"image_url": {
"type": "string",
"title": "Image Url",
"default": "https://telegra.ph/file/c6c8be08bfb1e27e558a1.png"
},
"room": {
"type": "string",
"title": "Room",
"description": "Room names could be one of these: `Living Room`, `Dining Room`, `Gaming Room`, `Bedroom`, `Bathroom`, `Office`, `Kitchen`, `Guest Room`, `Laundry Room`, `Home Theater`, `Playroom`, `Music Room`, `Exercise Room`, `Library`, `Sunroom`, `Mudroom`, `Attic`, `Basement`, `Pantry`, `Wine Cellar`, `Garage`, `Outdoor Living Space`, `Pool Room`, `Study Room`, `Home Office`, `House Exterior`, `Outdoor Pool Area`, `Outdoor Patio`, `Outdoor Garden`, `Meeting Room`, `Workshop`, `Fitness Gym`, `Coffee Shop`, `Clothing Store`, `Walk-in Closet`, `Toilet`, `Restaurant`, `Coworking Space`, `Hotel Lobby`, `Hotel Room`, `Hotel Bathroom`, `Exhibition Space`, `Onsen`, `Drop Zone`",
"default": "Living room"
},
"theme": {
"type": "string",
"title": "Theme",
"description": "Themes could be one of these: `Modern`, `Neutral`, `Monochromatic`, `Complementary`, `Cyberpunk`, `Analogous`, `Warm`, `Cool`, `Pastel`, `Black and white`, `Earthy`, `Vintage`, `Minimalist`, `Scandinavian`, `Bohemian`, `High-Contrast`, `Bright`, `Ocean-inspired`, `Rustic`, `Tropical`, `Bold`, `Jewel-toned`, `Art Deco`, `Mediterranean`, `Traditional`, `Beachy`, `Moody`, `Urban`, `Contemporary`, `Retro`, `Whimsical`, `Zen`, `Industrial`, `Biophilic`, `Farmhouse`, `Japanese Design`, `Coastal`, `Cottagecore`, `French Country`, `Maximalist`, `Art Nouveau`, `Baroque`, `Vaporwave`, `Ski Chalet`, `Sketch`, `Christmas`, `Tribal`, `Medieval`, `Chinese New Year`, `Halloween`, `Kelly Wearstler`, `Nate Berkus`, `Joanna Gaines`, `Martyn Lawrence Bullard`, `Philippe Starck`, `Emily Henderson`, `Miles Redd`, `Victoria Hagan`, `Tom Dixon`, `Timothy Corrigan`, `Axel Vervoordt`, `Kelly Hoppen`, `Ilse Crawford`, `India Mahdavi`, `David Collins`, `Thomas O'Brien`, `Jacques Garcia`, `Bunny Williams`, `Kelly Behun`, `Robert Couturier`",
"default": "Modern"
}
},
"type": "object",
"title": "Body_RoomGPT"
},
"ServerError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Internal Server Error"
}
},
"type": "object",
"title": "ServerError"
},
"ValidationError": {
"properties": {
"message": {
"type": "string",
"title": "Message",
"default": "Invalid request data"
}
},
"type": "object",
"title": "ValidationError"
},
"ValueError": {
"properties": {
"message": {
"type": "string",
"title": "Message"
}
},
"type": "object",
"required": [
"message"
],
"title": "ValueError"
}
}
},
"security": {},
"tags": []
}
```