Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ jobs:
os: [ubuntu-latest, windows-latest]
php-version: [8.2, 8.3, 8.4, 8.5]
prefer-lowest: ['']
exclude:
- os: windows-latest
php-version: 8.3
- os: windows-latest
php-version: 8.4
- os: windows-latest
php-version: 8.5
include:
- php-version: '8.2'
os: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require": {
"php": ">=8.2",
"cakephp/cakephp": "^5.2",
"mcp/sdk": "^0.3",
"mcp/sdk": "^0.4",
"ext-sqlite3": "*"
},
"require-dev": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<!-- Add any additional test suites you want to run here -->
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/DocumentationResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function searchResource(string $query): TextResourceContents
);
} catch (Exception $exception) {
$message = sprintf('Failed to read documentation resource: %s', $exception->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $exception->getCode(), $exception);
}
}

Expand Down Expand Up @@ -124,7 +124,7 @@ public function contentResource(string $docId): TextResourceContents
throw $exception;
} catch (Exception $exception) {
$message = sprintf('Failed to read documentation resource: %s', $exception->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $exception->getCode(), $exception);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Tools/DatabaseTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function listConnections(): array
];
} catch (Exception $e) {
$message = sprintf("Failed to get connection info for '%s': %s", $name, $e->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $e->getCode(), $e);
}
}

Expand Down Expand Up @@ -113,7 +113,7 @@ public function describeSchema(string $connection = 'default', ?string $table =
];
} catch (Exception $exception) {
$message = sprintf("Failed to read schema for connection '%s': %s", $connection, $exception->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $exception->getCode(), $exception);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Tools/DocumentationTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function searchDocs(
];
} catch (Exception $exception) {
$message = sprintf('Failed to search documentation: %s', $exception->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $exception->getCode(), $exception);
}
}

Expand All @@ -116,7 +116,7 @@ public function getStats(): array
return $this->searchService->getStatistics();
} catch (Exception $exception) {
$message = sprintf('Failed to get documentation statistics: %s', $exception->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $exception->getCode(), $exception);
}
}

Expand Down Expand Up @@ -164,7 +164,7 @@ public function getDocument(string $docId): array
throw $exception;
} catch (Exception $exception) {
$message = sprintf('Failed to get document: %s', $exception->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $exception->getCode(), $exception);
}
}
}
4 changes: 2 additions & 2 deletions src/Tools/RouteTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ public function matchUrl(string $url, string $method = 'GET'): array
];
} catch (MissingRouteException $e) {
$message = sprintf("No route matches URL '%s' with method '%s': %s", $url, $method, $e->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $e->getCode(), $e);
} catch (Exception $e) {
$message = sprintf("Error parsing URL '%s': %s", $url, $e->getMessage());
throw new ToolCallException($message);
throw new ToolCallException($message, $e->getCode(), $e);
}
}

Expand Down
Loading